Answers to: Processing passed arguments in scripthttp://linuxexchange.org/questions/1130/processing-passed-arguments-in-script<p>I'm trying to decide between short and long options, such as:</p> <p>-h </p> <p>vs.</p> <p>--help</p> <p>Obviously there are packages that deal with this, particularly in shell and perl programming.</p> <p>Getopts, Getopts::Std, and Getopts::Long</p> <p>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.</p> <p>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.</p>enSat, 24 Jul 2010 02:07:14 -0400Answer by Jazzhttp://linuxexchange.org/questions/1130/processing-passed-arguments-in-script/1131<p>I'm a fan of always providing both methods of argument notation, since different users have different needs.</p> <p>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.</p> <p>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)?</p>JazzSat, 24 Jul 2010 02:07:14 -0400http://linuxexchange.org/questions/1130/processing-passed-arguments-in-script/1131