Skip to content

Remove uname Help override, add test#180

Merged
julesmcrt merged 1 commit intomainfrom
jules.macret/Q/fix-uname-help
Apr 14, 2026
Merged

Remove uname Help override, add test#180
julesmcrt merged 1 commit intomainfrom
jules.macret/Q/fix-uname-help

Conversation

@julesmcrt
Copy link
Copy Markdown
Collaborator

@julesmcrt julesmcrt commented Apr 14, 2026

Builtins can have a Help field.
We want to ensure consistency between help command and command --help.
Only the commands with NoFlags should be able to override the Help field, adding a test to check that.

See https://man7.org/linux/man-pages/man1/uname.1.html

Before:

❯ ./rshell --allow-all-commands -c 'help uname'
uname: uname [-asnrvm]
    Print system information.

    With no flags, print the kernel name (same as -s).
    Reads from /proc/sys/kernel/ (configurable via --proc-path).

❯ ./rshell --allow-all-commands -c 'uname --help'
Usage: uname [OPTION]...
Print system information. With no OPTION, same as -s.

  -s, --kernel-name     print the kernel name
  -n, --nodename        print the network node hostname
  -r, --kernel-release  print the kernel release
  -v, --kernel-version  print the kernel version
  -m, --machine         print the machine hardware name
  -a, --all             print all information
      --help            display this help and exit

After:

❯ ./rshell --allow-all-commands -c 'uname --help'
Usage: uname [OPTION]...
Print system information. With no OPTION, same as -s.

  -s, --kernel-name     print the kernel name
  -n, --nodename        print the network node hostname
  -r, --kernel-release  print the kernel release
  -v, --kernel-version  print the kernel version
  -m, --machine         print the machine hardware name
  -a, --all             print all information
      --help            display this help and exit

❯ ./rshell --allow-all-commands -c 'help uname'
Usage: uname [OPTION]...
Print system information. With no OPTION, same as -s.

  -s, --kernel-name     print the kernel name
  -n, --nodename        print the network node hostname
  -r, --kernel-release  print the kernel release
  -v, --kernel-version  print the kernel version
  -m, --machine         print the machine hardware name
  -a, --all             print all information
      --help            display this help and exit

@julesmcrt julesmcrt added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit a01a0ed Apr 14, 2026
33 of 34 checks passed
@julesmcrt julesmcrt deleted the jules.macret/Q/fix-uname-help branch April 14, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants