Permalink
Browse files

add-command-line-flag : allow passing multiple flags

  • Loading branch information...
1 parent cda8c51 commit 4be62563aafcb22d98e1cd6068ef732a10e2df91 @MarcWeber MarcWeber committed Jul 23, 2009
Showing with 6 additions and 2 deletions.
  1. +6 −2 server/Scion/Server/Commands.hs
View
8 server/Scion/Server/Commands.hs
@@ -478,8 +478,12 @@ cmdForceUnload = Cmd "force-unload" $ noArgs $ unload
cmdAddCmdLineFlag :: Cmd
cmdAddCmdLineFlag =
- Cmd "add-command-line-flag" $ reqArg' "flag" fromJSString $ cmd
- where cmd flag = addCmdLineFlags [flag] >> return JSNull
+ Cmd "add-command-line-flag" $
+ optArg' "flag" "" fromJSString <&>
+ optArg' "flags" [] (map fromJSString) $ cmd
+ where cmd flag flags = do
+ addCmdLineFlags $ (if flag == "" then [] else [flag]) ++ flags
+ return JSNull
cmdThingAtPoint :: Cmd
cmdThingAtPoint =

0 comments on commit 4be6256

Please sign in to comment.