Skip to content

scripts/lint-shell.sh --help output is cut off mid-sentence (usage sed range stops one line early) #2529

Open

Description

@rahul05ranjan

What happens

scripts/lint-shell.sh --help (and -h) prints its usage block truncated in the middle of the last sentence:

$ bash scripts/lint-shell.sh --help
Lint shell scripts in this repository.

Usage:
  scripts/lint-shell.sh [--all] [--format] [--strict] [file ...]

By default, runs ShellCheck and shell syntax checks on changed shell scripts.
Use --format to format with shfmt before linting. Use --all for the full tracked

The final line of the header comment block, "baseline, or pass files explicitly to lint a smaller set.", is missing, so the help ends with a dangling "for the full tracked".

Cause

The usage() helper hardcodes a line range that ends one line short of the comment block:

scripts/lint-shell.sh lines 12-14:

usage() {
  sed -n '2,9p' "$0" | sed 's/^# \{0,1\}//'
}

The header comment runs through line 10 (verified on current main), so 2,9p drops exactly the last line. Sibling scripts avoid this by anchoring the range on markers instead of a fixed count, e.g. bump-version.sh uses /^# Usage:/ to end-of-block, and render-antigravity-logo.sh's range happens to cover its whole comment.

Suggested fix

Either extend the range:

sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'

or anchor it to the end of the comment block (e.g. print until the first non-# line, as bump-version.sh does with /^# Usage:/,/^# Requires:/-style markers), so adding a line to the header can't silently truncate the help again.

Activity

  1. added
    bug
    on Oct 21, 2026
  2. added
    issue-template-rules-ignored
    on Oct 22, 2026
  3. added a commit that references this issue on Oct 22, 2026
    2b74473
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

    bugissue-template-rules-ignoredneeds-repro-case

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions