-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Windows command completions #8486
Conversation
(Same goes for VER for example...) |
Yes, it's my mistake I've created completion for it. I will go through this command list and remove completions for internal cmd commands. |
I've done the small research on manned.org for utils with the same names and found out: There is only one "conflicting" completion in zsh-completions - for |
Everything is ready, please review this PR and accept if it's good enough. ;) |
share/completions/attrib.fish
Outdated
h\tClear the Hidden file attribute | ||
i\tClear the Not Content Indexed file attribute' | awk -F '\t' "{ printf \"$current_token%s\t%s\n\", \$1, \$2 }" | ||
case '*' | ||
if __fish_seen_argument --windows 's' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I run this, I get __fish_seen_argument: --windows: unknown option
- probably this needs to be
if __fish_seen_argument --windows 's' | |
if __fish_seen_argument -- --windows 's' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
share/completions/cleanmgr.fish
Outdated
/?\tShow help' | ||
end | ||
|
||
complete --command cleanmgr --no-files --arguments '(__cleanmgr_generate_args)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be rewritten to be similar to other completions with __fish_seen_subcommand
and similar. @faho might have a better idea.
C\tLight red | ||
D\tLight purple | ||
E\tLight yellow | ||
F\tBright white' | awk -F '\t' "{ printf \"$current_token%s\t%s\n\", \$1, \$2 }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This awk pipeline is pretty gnarly! I think it could be done with Cartesian expansion instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do smth like this:
echo prefix_(echo "1
2")
it prints prefix_1 prefix_2
. The problem is dealing with embedded spaces:
echo prefix_(echo "1
2 after-space")
How can I print each item on a separate line to pass them as a suggested completions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printf "$current_token"
is dangerous because `$current_token might contain a format specifier.
How can I print each item on a separate line to pass them as a suggested completions?
You can use printf %s\n
instead of echo
.
Here's the full Cartesian product expansion:
printf %s\n $current_token(
printf %s\t%s\n \
1 Blue \
2 Green
)
Thanks for this massive contribution! Before merging I think it needs to be brought into line with the way most of the other completions are written. That means shortening descriptions, using more It might be easier to just work on one or two at a time, if you like. |
- new name is __fish_print_windows_drives
- rename *list* functions to *print* - use short options everywhere - delegate less work to functions
- attributes - reg - schtasks
This relnotes completions from #8486
Description
Advanced command completions for 13 Windows commands.
Main features
ToDos