Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check --help and --version first instead of -h and -v #137

Open
p00f opened this issue Oct 7, 2023 · 6 comments
Open

check --help and --version first instead of -h and -v #137

p00f opened this issue Oct 7, 2023 · 6 comments
Labels
good first issue Good for newcomers

Comments

@p00f
Copy link

p00f commented Oct 7, 2023

Describe the bug

halp checks -h first, instead of --help. Some programs use -h for things other than help. Also, some programs have less detailed help in -h as compared to the --help flag of the same program.

Same thing applies to -v/--version

To reproduce

halp ps

Expected behavior

ps from procps-ng 4.0.4
Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).

Actual behavior

~: halp ^ps
(°ロ°)  checking '^ps -v'
\(^ヮ^)/ success '-v' argument found!
---
    PID TTY      STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
    760 tty1     Sl+    0:00    137 33583 1213520 23728  0.3 nu /home/chinmay/.l
    784 tty1     Sl+   32:05     20   388 2219531 107972  1.5 river
    799 tty1     Sl+    0:00     23  1598 918449 128324  1.8 Xwayland :0 -rootle
 323577 pts/0    Ssl    0:00      0 33583 1349608 61992  0.8 /usr/bin/nu
 323688 pts/0    Sl+    0:20     81  1265 3437670 303100  4.3 mpv 2023-08-25.mp4
 372787 pts/1    Ssl    0:00      0 33583 1282032 60536  0.8 /usr/bin/nu
 372833 pts/1    S+     0:00      0  1648  4463  3456  0.0 halp ^ps
 372835 pts/1    S+     0:00      0    23  5496  2048  0.0 script -q -e -c ^ps -
 372837 pts/2    Ssl+   0:00      0 33583 1213520 36112  0.5 nu -c ^ps -v
 372839 pts/2    R+     0:00      0    60 11243  4864  0.0 ps -v
---
(°ロ°)  checking '^ps -h'
\(^ヮ^)/ success '-h' argument found!
---
    760 tty1     Sl+    0:00 nu /home/chinmay/.local/bin/river.nu
    784 tty1     Sl+   32:05 river
    799 tty1     Sl+    0:00 Xwayland :0 -rootless -core -terminate -listenfd 25
 323577 pts/0    Ssl    0:00 /usr/bin/nu
 323688 pts/0    Sl+    0:20 mpv 2023-08-25.mp4
 372787 pts/1    Ssl    0:00 /usr/bin/nu
 372833 pts/1    S+     0:00 halp ^ps
 372842 pts/1    S+     0:00 script -q -e -c ^ps -h /dev/null
 372844 pts/2    Ssl+   0:00 nu -c ^ps -h
 372846 pts/2    R+     0:00 ps -h
---

Software information

  • Operating system: uname -a: Linux ganymede 6.5.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 23 Sep 2023 22:55:13 +0000 x86_64 GNU/Linux
  • Rust version: N/A (distro package)
  • Project version: 0.1.7

Additional context

None

@p00f p00f added the bug Something isn't working label Oct 7, 2023
@p00f p00f changed the title check --help first instead of -h check --help and --version first instead of -h and -v Oct 7, 2023
@p00f
Copy link
Author

p00f commented Oct 16, 2023

I just saw this is configurable, closing

@p00f p00f closed this as completed Oct 16, 2023
@orhun orhun removed their assignment Oct 17, 2023
@orhun orhun added good first issue Good for newcomers and removed bug Something isn't working labels Oct 17, 2023
@orhun
Copy link
Owner

orhun commented Oct 17, 2023

I think it would be nice to make this the default behavior!

@orhun orhun reopened this Oct 17, 2023
@p00f
Copy link
Author

p00f commented Oct 17, 2023

In that case, this is what I have:
check = [ [ "--version", "-v", "version", "-V" ], [ "--help", "-h", "help", "-H" ] ]

@orhun
Copy link
Owner

orhun commented Oct 17, 2023

Are you interested in making a PR to make it the internal default as well? If not, it's fine 😃

@p00f
Copy link
Author

p00f commented Oct 17, 2023

Too much work just for a one-line change 😛

@orhun
Copy link
Owner

orhun commented Oct 17, 2023

Fair enough :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants