Skip to content

Explain the passwordless sudo modes in its help - #16236

Open
kstaikov wants to merge 1 commit into
omacom:quattrofrom
kstaikov:sudo-passwordless-help
Open

kstaikov wants to merge 1 commit into
omacom:quattrofrom
kstaikov:sudo-passwordless-help

Conversation

@kstaikov

Copy link
Copy Markdown

omarchy-sudo-passwordless --help printed only Usage: omarchy-sudo-passwordless [MINUTES|permanent|--active|--disable] to stderr and exited 1, the same as an invalid duration. Nothing told the user that running it with no argument turns access off when it is on and otherwise asks how long to allow it, what --active and --disable do, or that permanent survives reboots. omarchy sudo passwordless --help showed the same bare argument list with no examples.

This handles -h/--help explicitly, prints a usage block to stdout that describes each mode, and keeps the stderr/exit-1 form for invalid arguments. The router's help gets the same picture through the summary and examples:

Usage: omarchy-sudo-passwordless [MINUTES|permanent|--active|--disable]
  (no args)   turn passwordless sudo off when it is on; otherwise ask how long
              to allow it (15 minutes, 1 hour, 1 day, or permanently)
  MINUTES     allow it for 1-1440 minutes, or change how long an active grant lasts
  permanent   allow it until disabled, surviving reboots and updates
  --disable   turn it off without asking
  --active    exit 0 while it is on and 1 otherwise, printing nothing

Context: on the 4.0.x command, Ctrl-C at the password prompt fell through to the enable path and announced a 15-minute default that was never asked for. quattro already fixes that (#14435 asks for a duration, and the security traps exit on Ctrl-C), but its help still left the modes and the duration prompt unexplained.

Tested with bash test/shell.d/nopasswd-sudo-expiry-test.sh (the added check fails on quattro without the script change) and ./test/cli.

🤖 Generated with Claude Code

`omarchy-sudo-passwordless --help` printed only the bare argument list to
stderr and exited 1, as if the flag were an invalid duration. Nothing told
the user that running it with no argument turns access off when it is on
and otherwise asks how long to allow it, what `--active` and `--disable`
do, or that `permanent` survives reboots.

Handle `-h`/`--help` explicitly, print a usage block that describes each
mode, and keep the stderr/exit-1 form for invalid arguments. Give the
router's help the same picture through the summary and examples.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Adds explicit -h and --help support to omarchy-sudo-passwordless.

  • Passwordless sudo help now explains each mode and exits cleanly.

Reviews (1) · Last reviewed commit: "Explain the passwordless sudo modes in i..." · Reviewed by Greptile

@omarchybot omarchybot added the enhancement New feature or request label Oct 22, 2026

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants