ff
ff copied to clipboard
ffcli: mixing flags and positional arguments
Is there a good strategy for doing something like this?
In the example: https://github.com/peterbourgon/ff/blob/main/ffcli/examples/objectctl/pkg/createcmd/create.go allowing the --overwrite flag to come at the end of the line: objectctl create <key> <value data...> --overwrite. kubectl is a good example of a program that behaves this way. You can put cli flags damn near anywhere in it.
I'm porting over a cli app from another language and would like to keep the same cli syntax that it has (and it has flags after the positional arg). But if you provide the flag at the end, it becomes part of the args parameter of Exec.