Hello monks!
I'm working with Longops on a project, but given the sheer number of options in the code I'm writing, I've managed to get myself confused. Seen in the snippet below is a sample of "options", each one acting a little different.
'add-domain|ad=s', # Add a domain. -n and -t are optional -ad 'do +main.com' -n 'Note like this' -t
This action can either be called with "-ad", "-ad -n", or "-ad -n -t", or "-ad -t" (each one obviously having a value). "-ad" is the actual action, -t and -n are supplementary to -ad.
'show-domains|sd', # Show all domains and their IDs -sd
The above action can only be called with "-sd". It takes no value (its a bool)
My question, and I guess my confusion, too is in the best way to go about getting parameters, sanitizing them, and validating their ability to go together. There are a total of about 30 different (and unique) options, some taking a value, some that are just bools.
Currently, I'm using a hash via GetOptions (\%options, and am just looking for values.
Cheers!
Libby
In reply to Getopt::Long via. Hashes by librarat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |