-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
fetch-configlet: print instructions for installing completions #647
base: main
Are you sure you want to change the base?
Conversation
Format with: shfmt -i 2 -ci -sr -kp `shfmt` usage: $ shfmt --version 3.5.1 $ shfmt --help usage: shfmt [flags] [path ...] shfmt formats shell programs. If the only argument is a dash ('-') or no arguments are given, standard input will be used. If a given path is a directory, all shell scripts found under that directory will be used. --version show version and exit -l, --list list files whose formatting differs from shfmt's -w, --write write result to file instead of stdout -d, --diff error with a diff when the formatting differs -s, --simplify simplify the code -mn, --minify minify the code to reduce its size (implies -s) Parser options: -ln, --language-dialect str bash/posix/mksh/bats, default "auto" -p, --posix shorthand for -ln=posix --filename str provide a name for the standard input file Printer options: -i, --indent uint 0 for tabs (default), >0 for number of spaces -bn, --binary-next-line binary ops like && and | may start a line -ci, --case-indent switch cases will be indented -sr, --space-redirects redirect operators will be followed by a space -kp, --keep-padding keep column alignment paddings -fn, --func-next-line function opening braces are placed on a separate line Utilities: -f, --find recursively find all shell files and print the paths --tojson print syntax tree to stdout as a typed JSON For more information, see 'man shfmt' and https://github.com/mvdan/sh.
It's cool that we try to detect a user's shell. But I have these questions:
For example, a user might use fish as an interactive shell only, as discussed on the Arch wiki. Right now, for such a user,
may return
in which case the user sees instructions for a different shell. Or it may return, say:
in which case the user wouldn't see any instructions for installing completions, even though they're available. Related recent post of Glenn's on unix.stackexchange.com:
|
If there isn't a reliable, fool-proof way to detect the user's shell, I think we should print the instructions for every supported shell. |
No, unless we parse
I think this was my original suggestion: let the user tell you what shell they want: configlet completions -s fish Perhaps if the |
Let's do that.
Hah. I think that'd be trying to be much too clever.
We'll have this in the next configlet release (but with the subcommand called The help message will contain
So the main remaining step is to make I think this PR doesn't block the configlet release, though. |
Closes: #635
@glennj I've taken the liberty of taking your commit from glennj@e55d775 to begin this PR, which should be attributed to you.
The first commit in this PR is just that commit, but rebased on
main
. Feel free to push to this PR's branch.This PR is a follow-up to #629, where these changes were originally.