refactor: allow -h between command and args
This commit is contained in:
parent
50dd829d90
commit
ffcf715f30
1 changed files with 3 additions and 2 deletions
|
|
@ -349,12 +349,13 @@ def processArgs : CliM PUnit := do
|
|||
| [] => IO.println usage
|
||||
| ["--version"] => IO.println uiVersionString
|
||||
| _ => -- normal CLI
|
||||
processLeadingOptions
|
||||
processLeadingOptions -- between `lake` and command
|
||||
if let some cmd ← takeArg? then
|
||||
processLeadingOptions -- between command and args
|
||||
if (← getWantsHelp) then
|
||||
IO.println <| help cmd
|
||||
else
|
||||
processOptions
|
||||
processOptions -- after/intermixed with args
|
||||
command cmd
|
||||
else
|
||||
if (← getWantsHelp) then IO.println usage else error "expected command"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue