-
-
Notifications
You must be signed in to change notification settings - Fork 763
Closed
Description
Description
Context
Passing CLI args is possible by (ref - Forwarding CLI arguments to commands ):
tasks:
yarn:
cmds:
- yarn {{.CLI_ARGS}}and called as: task yarn -- install
But there's no flag support, requiring a lot of times to hardcode as env within taskfile, or using positional arguments and mapping the flags to position within the CLI args, for example:
tasks:
somecommand:
cmds:
- |
set -- {{.CLI_ARGS}}
arg1=$1
arg2=$2
echo command --flag1 "$arg1" --flag2 "$arg2" What can be added
Adding options under the special .CLI.ARGS variable, so something the use can be something as follows:
tasks:
somecommand:
cmds:
- echo command --flag1 {{.CLI.ARGS.flag1}} --flag2 {{.CLI.ARGS.flag1}}Makes the param passing for calling commands with multiple flags much better, not having to deal with postional args splitting, or calling scripts to deal with this logic everytime.
Iron-Ebdreece
Metadata
Metadata
Assignees
Labels
No labels