rename/update doc
This commit is contained in:
parent
c9f1f5c663
commit
17b1fcefed
@ -318,7 +318,7 @@ toCliOpts rawopts = do
|
|||||||
getHledgerCliOpts :: [String] -> IO CliOpts
|
getHledgerCliOpts :: [String] -> IO CliOpts
|
||||||
getHledgerCliOpts addons = do
|
getHledgerCliOpts addons = do
|
||||||
args <- getArgs
|
args <- getArgs
|
||||||
toCliOpts (decodeRawOpts $ processValue (mainmode addons) $ moveFileOption args) >>= checkCliOpts
|
toCliOpts (decodeRawOpts $ processValue (mainmode addons) $ rearrangeForCmdArgs args) >>= checkCliOpts
|
||||||
|
|
||||||
-- utils
|
-- utils
|
||||||
|
|
||||||
@ -344,12 +344,12 @@ getDirectoryContentsSafe d = getDirectoryContents d `catch` (\_ -> return [])
|
|||||||
-- | Convert possibly encoded option values to regular unicode strings.
|
-- | Convert possibly encoded option values to regular unicode strings.
|
||||||
decodeRawOpts = map (\(name,val) -> (name, fromPlatformString val))
|
decodeRawOpts = map (\(name,val) -> (name, fromPlatformString val))
|
||||||
|
|
||||||
-- A workaround related to http://code.google.com/p/ndmitchell/issues/detail?id=457 :
|
-- A hacky workaround for http://code.google.com/p/ndmitchell/issues/detail?id=470 :
|
||||||
-- we'd like to permit options before COMMAND as well as after it. Here we
|
-- we'd like to permit options before COMMAND as well as after it.
|
||||||
-- make sure at least -f FILE will be accepted in either position.
|
-- Here we make sure at least -f FILE will be accepted in either position.
|
||||||
moveFileOption (fopt@('-':'f':_:_):cmd:rest) = cmd:fopt:rest
|
rearrangeForCmdArgs (fopt@('-':'f':_:_):cmd:rest) = cmd:fopt:rest
|
||||||
moveFileOption ("-f":fval:cmd:rest) = cmd:"-f":fval:rest
|
rearrangeForCmdArgs ("-f":fval:cmd:rest) = cmd:"-f":fval:rest
|
||||||
moveFileOption as = as
|
rearrangeForCmdArgs as = as
|
||||||
|
|
||||||
optserror = error' . (++ " (run with --help for usage)")
|
optserror = error' . (++ " (run with --help for usage)")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user