You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a toy implementation of a command that is supposed to execute a sub-command for each package in a monorepo. It takes as arguments the sub-command to run in the context of each package, and an optional flag to exclude certain packages from the process.
If I type a wrong command, the help text suggests the wrong syntax, with the flags after the command. Given how the usage function is structured, I think it would show up also in the help for the single command, if it could be accessed.
$ mytool wrong Unknown Syntax Error: Command not found; did you mean one of: 0. mytool -h 1. mytool -v 2. mytool each [-x,--exclude #0] ...While running wrong
Any suggestions for that?
The text was updated successfully, but these errors were encountered:
exportclassRunCommandextendsCommand{staticname='run';staticpaths=[[RunCommand.name]];args=Option.Proxy();asyncexecute(){// help command is consumed by Option.Proxy// see https://github.com/arcanis/clipanion/issues/88consthelpFlags=newSet(Builtins.HelpCommand.paths.map(path=>path[0]));consthelpFlagIndex=this.args.findIndex(flag=>helpFlags.has(flag));if(-1<helpFlagIndex&&helpFlagIndex<[...this.args,'--'].indexOf('--')){this.context.stdout.write(this.cli.usage(RunCommand,{detailed: true}));return;}// …}}
This way … run --help shows the clipanion help while … run -- --help proxies the help flag.
This is a toy implementation of a command that is supposed to execute a sub-command for each package in a monorepo. It takes as arguments the sub-command to run in the context of each package, and an optional flag to exclude certain packages from the process.
The usage (after taking into account #85, having the flags preceding the command) would be:
This works correctly, or at least according to the expectations lined out in #85. If I try to get help for this command, though, things go wrong:
Inverting the command and the flag also goes wrong – for different reasons:
If I type a wrong command, the help text suggests the wrong syntax, with the flags after the command. Given how the
usage
function is structured, I think it would show up also in the help for the single command, if it could be accessed.Any suggestions for that?
The text was updated successfully, but these errors were encountered: