Issue
Is there a style guide to writing command line applications' arguments on unix platforms? Coming from the iOS world I'm thinking of something akin to the href="http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html" rel="noreferrer">Human Interface Guidelines (HIG). I'm writing a script in Python that can take parameters.
Example: How to name arguments, when to use -dash
or --doubleDash
.
Solution
The GNU Coding Standards have a section on command line programs.
For a posixy feel, you shouldn't only provide the standard command line options, both short and long, but also, if possible, adhere to reading from the standard input (or the command line) and writing to the standard output, and only overriding the output with an option (like -o
/--output
). That's what one expects of most GNU command line tools.
Answered By - Kerrek SB Answer Checked By - Dawn Plyler (WPSolving Volunteer)