hs-cli icon indicating copy to clipboard operation
hs-cli copied to clipboard

Argument crashes with command

Open nishirken opened this issue 2 years ago • 0 comments

Hello This code:

import Console.Options

main = defaultMain $ do
    arg <- argument "" $ \raw -> Right raw
    command "sample" $ 
      action $ \toParam ->
        putStrLn $ show $ toParam arg

throws error:

Prelude.!!: index too large

whereas this code:

import Console.Options

main = defaultMain $ do
    arg <- argument "" $ \raw -> Right raw
    action $ \toParam ->
      putStrLn $ show $ toParam arg

works well

version 0.2.0

nishirken avatar Apr 10 '22 07:04 nishirken