I'm trying to decide between short and long options, such as: -h vs. --help Obviously there are packages that deal with this, particularly in shell and perl programming. Getopts, Getopts::Std, and Getopts::Long I would prefer to use both, both -h and --help being a call for a help/usage function, but that requires quite a bit more effort. So my question is, what are the pros and cons of both, while I like the readability of the long notation, it's also nice and cleaner to be able to use just the simple single character flags. asked 23 Jul '10, 15:37 rfelsburg ♦ |
I'm a fan of always providing both methods of argument notation, since different users have different needs. If you have to make a decision, analyzing your future userbase might help you make your decision. If your users are Linux administrators, it is likely that they are happy with the short notation. Other, less technically-savvy, people might be more happy with the long notation of arguments. Also, the usage of the script itself is of importance. Will users be typing arguments often (short notation is advisable) or will the script be called automatically from another script/program (long notation for better readability and maintainability)? answered 24 Jul '10, 02:07 Jazz ♦ I think I found a way to do both, it took quite a bit of reading but Getopts::Long in perl allows for the usage of both via a pipe command in the initial setup. I to am a fan of both, but was wondering on different folks views on each.
(24 Jul '10, 17:10)
rfelsburg ♦
|