Skip to content

State the CLI Usage Gate's Stricter Reading in CODESTYLE's Argument Rule #2949

Closed

Description

@ptr727

CODESTYLE.md "Command-Line Arguments" (and its includes in the python-codestyle and shell-codestyle Skills) requires a script to answer --help and -h by "printing its usage and exiting 0", and to refuse an unrecognized argument "with a non-zero exit before any read or write".

After #2944 the CLI usage gate (tests/test_cli_usage.py) reads that rule more strictly, as #2831 asked, and requires:

  • help on stdout whose very first line is a usage line with the script's name as a word;
  • the same help text for -h and --help;
  • a refusal whose text names the unknown flag as an unknown or unrecognized option, argument, flag or parameter.

A script written to the rule's words, for example one that refuses with "error: --bogus-flag is not a valid option" or prints a banner before its usage line, fails the gate, and no rule text tells its author why. The module docstring now says the gate reads the rule strictly, but the rule itself is where an author looks.

Proposed: state those three requirements in CODESTYLE.md's rule, regenerate the Skills' includes, and keep the gate as the rule's enforcement.

Activity

  1. added
    gate
    introduced
    on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gateintroduced

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions