Instead of only allowing flags to be passed by an environment variable, consider using sub-commands or passing a double-dash to stop parsing for the main CLI tool. ie:
```
aos --config ./blah.yml -- my_alias -i input.mp4 -o output.gif
# or
aos exec mv $x $y
```
forcing the user to specify a config file each time you run the command is also a bad design. Create a list of acceptable paths (including $PWD), iterate over them looking for a config, and then allow a "--config" flag to have precedence over any default path.
as of now you have to specify an env var in lieu of passing flags to the tool AND you have to specify a config file. At that point it is just easier to use shell functions or scripts.
check out "jessevdk/go-flags" you can do the env var thing, pass with flags and subcmds and honor the double dash to stop parsing. Its real straightforward.
1 comment
[ 2.9 ms ] story [ 9.6 ms ] thread``` aos --config ./blah.yml -- my_alias -i input.mp4 -o output.gif
# or
aos exec mv $x $y
```
forcing the user to specify a config file each time you run the command is also a bad design. Create a list of acceptable paths (including $PWD), iterate over them looking for a config, and then allow a "--config" flag to have precedence over any default path.
as of now you have to specify an env var in lieu of passing flags to the tool AND you have to specify a config file. At that point it is just easier to use shell functions or scripts.
check out "jessevdk/go-flags" you can do the env var thing, pass with flags and subcmds and honor the double dash to stop parsing. Its real straightforward.