Search code examples
readme

What is the "proper" way to write out "command line/command-line" in the context of documentation?


I was proofreading a README file and noticed inconsistent spelling of a phrase spelled two ways: "command line" and "command-line". I went looking for a conclusive answer and did not find much (see this archived exchange and this Microsoft style guide page). I concluded that it probably doesn't matter and that "command line" seems to be more common, but now I'm curious; has anyone else run into this issue? If you're an industry professional that documents your code, were you ever provided an answer?

Side note: I was debating whether or not to ask this here, as it's certainly more of a code-adjacent question, but considering that if you're writing code, you should be writing documentation as well, I figured it would fit the criteria of "a practical, answerable problem that is unique to software development" stated here. If this is not the case, do let me know-- thanks!


Solution

  • Both "command line" and "command-line" are acceptable and widely used in today's writing. When used as an adjective before a noun, use "command-line" (with a hyphen) in your writing to help prevent confusion. For example, in the sentence "Make sure you entered the correct command-line parameter." the word "command-line" is describing a type of parameter.

    When used as a noun, use "command line" (with no hyphen) in your writing. For example, in the sentence "Open the command line." the use of "command line" is used as a noun.