@@ -1601,6 +1601,8 @@ idrisMain opts =
16011601 let cgn = case opt getCodegen opts of
16021602 [] -> Via "c"
16031603 xs -> last xs
1604+ let cgFlags = opt getCodegenArgs opts
1605+
16041606 -- Now set/unset specifically chosen optimisations
16051607 sequence_ (opt getOptimisation opts)
16061608 script <- case opt getExecScript opts of
@@ -1625,6 +1627,7 @@ idrisMain opts =
16251627 setOutputTy outty
16261628 setNoBanner nobanner
16271629 setCodegen cgn
1630+ mapM_ (addFlag cgn) cgFlags
16281631 mapM_ makeOption opts
16291632 -- if we have the --bytecode flag, drop into the bytecode assembler
16301633 case bcs of
@@ -1839,6 +1842,9 @@ getCodegen :: Opt -> Maybe Codegen
18391842getCodegen (UseCodegen x) = Just x
18401843getCodegen _ = Nothing
18411844
1845+getCodegenArgs :: Opt -> Maybe String
1846+getCodegenArgs (CodegenArgs args) = Just args
1847+getCodegenArgs _ = Nothing
18421848
18431849getConsoleWidth :: Opt -> Maybe ConsoleWidth
18441850getConsoleWidth (UseConsoleWidth x) = Just x