Skip to content

Guideline for one_liners

adrianbartyczak edited this page Dec 10, 2017 · 16 revisions

Guideline for one-liners in Shell.

  1. General
  2. Format
  3. Code style

General

A one-liner ...

  • has a description.
  • is continued on a single line (for easy maintenance of layout when copying and pasting to a script or terminal).

Format

One-liner files are created in the following format:
(Note: Any section in addition to Description is included if necessary)

# ======= #.  SECTION NAME =====================================

# Description
one-liner

# Description
one-liner

# Description
# Note: Note line 1
#   Note line 2
#   ...
one-liner

Documentation lines

  • The maximum length for a documentation line is 120 characters.
  • A documentation section continued on another line is indented 2 spaces.

Other

  • Any documentation section other than Description is included if necessary.

For an example, see one-liners-gnu-linux-output_only-single-value.bash.

Code style

General

Variables
  • A variable name uses acronyms whenever possible.

All other code style rules are up to the contributor.

Clone this wiki locally