Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The long-standing convention here, particularly for command line usage, is that:

- String literals should be in lowercase (because by convention commands, argument names, etc should always be in all-lowercase, eg. "git cherry-pick" not "git cherryPick" or "git CHERRY-PICK")

- Metavariables (stuff the user should fill in) should be in ALL-CAPS.

- Not as strictly adhered to but still useful, [optional part] and {repeatable part}.

So eg. your example might look like:

    $ bin/rails generate scaffold --user=NAME --email=LOGIN
and an example usage would then be:

    $ bin/rails generate scaffold --user=ekimekim --email=ekimekim@example.com
As far as I'm concerned, for documenting command usage, there is no excuse not to use this scheme.



> Metavariables (stuff the user should fill in) should be in ALL-CAPS.

If possible, (like it is here on HN), metavariables should be in ALL_CAPS_AND_ITALICS, because that’s how it’s done in Unix manual pages.

If italics is not available, it might be more clear to use the $SHELL_VARIABLE convention, depending on the audience.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: