Lets say I am building an interface with the following command:
$ run --display (file/env/db) # default to file if invalid is entered
What I am looking for specifically is how to obtain an enum value with the following:
Given:
data type = File | Env | Db
When the command run --display file is entered, the enum File is returned.
As far as I know, the strOption and strArgument functions are used for any arbitrary string argument. I have read the complete documentation but couldn't figure out any easy solution for this. Any help would be appreciated.
You can work with a custom parser, like:
and then parse the options with: