Skip to content

Decide on when to provide a --help flag for bash scripts #16

@jotaen4tinypilot

Description

@jotaen4tinypilot

Our bash scripts currently don’t follow a consistent pattern in regards to whether they provide a --help option. E.g.,

My suggestion would be:

  • If a bash script is supposed to be user-facing, then it should provide a --help flag.
  • If a bash script is for internal purposes (i.e., programmatic usage), it shouldn’t provide a --help flag.
    • For instance: all our privileged scripts.
    • However, a docstring comment at the top should then be mandatory.

The downside of providing a --help flag is the significant amount of boilerplate code it requires. To illustrate this: is-ssh-enabled has 24 LOC – only 6 of which are actual logic, and 18 are for processing the --help flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions