I'm making a CLI with SwiftArgumentParser and so far I'm really enjoying it, it's a pleasure to use. However I have one question relating to the automatically generated --version
option.
It has been brought to my attention by a friend that it's a bit counter intuitive having the --version
option allowed in places like swift-bundler templates --version
(where you might expect that it would print the version of the templates repository) or swift-bundler create MyApp --version
(where you might expect that it would allow you to provide an initial version to put in the app's configuration). In both cases, the command just prints the root command's version and exits.
Is there a way to disable this 'propagation' of the automatic version command and limit it to only the root command? Because realistically that's the only place someone would ever want to/expect to be able to use the automatically generated version option.