We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is a minimal showcase of the error I am facing:
If I declare a newtype datatype - then flags produce runtime errors. For data-declarations everything seems to work just fine.
newtype
data
{-# LANGUAGE DeriveDataTypeable #-} module Main where import System.Console.CmdArgs --------------------------------------------------------------------------------- -- Newtypes seem to make problems with CMDARGS -- --------------------------------------------------------------------------------- newtype NewtypeSample = NewtypeSample {helloNT :: FilePath } deriving (Show, Data, Typeable) worksNT = NewtypeSample{helloNT = def &= help "World argument" } &= summary "NewtypeSample v1" doesn'tWorkNT1 = NewtypeSample{helloNT = def &= help "World argument" &= opt "world" &= typFile} &= summary "NewtypeSample v1" doesn'tWorkNT2 = NewtypeSample{helloNT = def &= help "World argument" &= opt "world"} &= summary "NewtypeSample v1" --------------------------------------------------------------------------------- -- Data declarations seem to work just fine -- --------------------------------------------------------------------------------- data DataSample = DataSample {helloD :: FilePath } deriving (Show, Data, Typeable) worksD1 = DataSample{helloD = def &= help "World argument" &= opt "world"} &= summary "DataSample v1" worksD2= DataSample{helloD = def &= help "World argument" &= opt "world" &= typFile} &= summary "DataSample v1" main :: IO () main = do print =<< cmdArgs doesn'tWorkNT1 print =<< cmdArgs doesn'tWorkNT2 print =<< cmdArgs worksNT print =<< cmdArgs worksD1 print =<< cmdArgs worksD2 return ()
Here are the errors I get:
stack build && stack exec -- cmdargsbug cmdargsbug-0.1.0.0: build (exe) Preprocessing executable 'cmdargsbug' for cmdargsbug-0.1.0.0... [1 of 1] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/cmdargsbug/cmdargsbug-tmp/Main.o ) Linking .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/cmdargsbug/cmdargsbug ... cmdargsbug-0.1.0.0: copy/register Installing executable(s) in ..../cmdargsbug/.stack-work/install/x86_64-linux/lts-8.17/8.0.2/bin cmdargsbug: System.Console.CmdArgs.Implicit, unexpected mode: FlagType "FILE" CallStack (from HasCallStack): error, called at ./System/Console/CmdArgs/Implicit/Local.hs:106:11 in cmdargs-0.10.17-IWa8ygdJhnJBShkQXN8V9I:System.Console.CmdArgs.Implicit.Local
commenting out the doesn'tWorkNT1 line produces
doesn'tWorkNT1
stack build && stack exec -- cmdargsbug cmdargsbug-0.1.0.0: build (exe) Preprocessing executable 'cmdargsbug' for cmdargsbug-0.1.0.0... [1 of 1] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/cmdargsbug/cmdargsbug-tmp/Main.o ) Linking .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/cmdargsbug/cmdargsbug ... cmdargsbug-0.1.0.0: copy/register Installing executable(s) in ..../cmdargsbug/.stack-work/install/x86_64-linux/lts-8.17/8.0.2/bin cmdargsbug: System.Console.CmdArgs.Implicit, unexpected mode: FlagOptional "world" CallStack (from HasCallStack): error, called at ./System/Console/CmdArgs/Implicit/Local.hs:106:11 in cmdargs-0.10.17-IWa8ygdJhnJBShkQXN8V9I:System.Console.CmdArgs.Implicit.Local
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here is a minimal showcase of the error I am facing:
If I declare a
newtype
datatype - then flags produce runtime errors.For
data
-declarations everything seems to work just fine.Here are the errors I get:
commenting out the
doesn'tWorkNT1
line producesThe text was updated successfully, but these errors were encountered: