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

Fix apt subcommand option completions #4350

Closed

Conversation

@radek-sprta
Copy link
Contributor

@radek-sprta radek-sprta commented Aug 21, 2017

Description

Repost of #4330.

As title says, option completion for apt list was offering only general flags, not the subcommand specific ones. This fixes it.

Fixes issue #

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.md
@@ -23,6 +23,20 @@ function __fish_apt_subcommand
complete -f -c apt -n '__fish_apt_no_subcommand' -a $subcommand $argv
end

function __fish_apt_using_subcommand --description 'Test if given subcommand is used'
for i in (commandline -opc)
if contains -- $i $argv[1]

This comment has been minimized.

@krader1961

krader1961 Aug 22, 2017
Contributor

Why $argv[1] rather than just $argv? If more than one value is passed in isn't that an error?

This comment has been minimized.

@radek-sprta

radek-sprta Aug 22, 2017
Author Contributor

You are right, it should be just $argv.

end

function __fish_apt_option
set subcommand $argv[1]; set -e argv[1]

This comment has been minimized.

@krader1961

krader1961 Aug 22, 2017
Contributor

Please do not put multiple commands on the same line separated by a semicolon.

@krader1961
Copy link
Contributor

@krader1961 krader1961 commented Aug 23, 2017

Thx. Merged as commit 27d7fea in the Integration_2.7.0 branch and cherry-picked into master (3.0.0).

@krader1961 krader1961 closed this Aug 23, 2017
@zanchey zanchey added this to the fish 2.7.0 milestone Aug 23, 2017
@zanchey zanchey added the completions label Aug 23, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.