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

Fallback to cmd --help when man cmd errors #8041

Closed
wants to merge 1 commit into from

Conversation

cljoly
Copy link

@cljoly cljoly commented Jun 1, 2021

Description

In __fish_man_page.fish, call cmd --help (resp. cmd sub --help) when man cmd (resp. man cmd-sub) does not exist.

I’m unsure if this is worth adding an entry in CHANGELOG.rst

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

In __fish_man_page.fish, call `cmd --help` (resp. `cmd sub --help`) when `man cmd` (resp. `man cmd-sub`) does not exist.
@faho
Copy link
Member

faho commented Jun 1, 2021

Calling the command here in any way is dangerous. If the command does not take --help as an option you've now done something.

E.g. Solaris' killall ignores all arguments and kills all processes (IIRC).

This is not a feature that should be added, sorry!

@faho faho closed this Jun 1, 2021
@faho faho added this to the will-not-implement milestone Jun 1, 2021
@zanchey
Copy link
Member

zanchey commented Jun 1, 2021

E.g. Solaris' killall ignores all arguments and kills all processes (IIRC).

Yes. More specifically, it kills all processes belonging to a user, problematic if you are logged in as root. Ask me how I know. routef is another landmine for the unwary.

@cljoly
Copy link
Author

cljoly commented Jun 1, 2021

Right, that makes sense.
How would you feel about having a prompt like (the if cmd --help part would be removed):

Do you want to see `cmd --help`? [Y/n]

The main drawback I see is that it makes calls to __fish_man_page blocking for the user.

@zanchey
Copy link
Member

zanchey commented Jun 2, 2021

That is not a question that users can give a useful answer to unless they are already sure that the command is safe.

@cljoly
Copy link
Author

cljoly commented Jun 2, 2021

That’s a good point.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants