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

Flatpak completion includes extra text #4456

Closed
TingPing opened this issue Oct 8, 2017 · 8 comments
Closed

Flatpak completion includes extra text #4456

TingPing opened this issue Oct 8, 2017 · 8 comments
Labels
Milestone

Comments

@TingPing
Copy link

@TingPing TingPing commented Oct 8, 2017

Fish version: 2.6.0
Flatpak version: 0.9.12

Flatpak completion of applications is currently broken probably as the format of Flatpaks cli output has changed:

https://asciinema.org/a/8dCLh0bJNwqRiWfVvds2C1hIx

@mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Oct 8, 2017

Can flatpack URLs contain spaces?

@TingPing
Copy link
Author

@TingPing TingPing commented Oct 8, 2017

An app-id cannot contain spaces.

@mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Oct 8, 2017

Can you try the attached diff? You can just apply it to /usr/local/share/fish/completions/flatpak.fish:

diff --git a/share/completions/flatpak.fish b/share/completions/flatpak.fish
index 5860c6b..565ab0b 100644
--- a/share/completions/flatpak.fish
+++ b/share/completions/flatpak.fish
@@ -30,9 +30,9 @@ complete -f -c flatpak -n "not __fish_seen_subcommand_from $commands" -a build-i
 complete -f -c flatpak -n "not __fish_seen_subcommand_from $commands" -a build-sign          -d 'Sign an application or runtime'
 complete -f -c flatpak -n "not __fish_seen_subcommand_from $commands" -a build-update-repo   -d 'Update the summary file in a repository'

-complete -f -c flatpak -n "__fish_seen_subcommand_from run" -a "(flatpak list --app | string trim)"
-complete -f -c flatpak -n "__fish_seen_subcommand_from info uninstall" -a "(flatpak list | string trim)"
-complete -f -c flatpak -n "__fish_seen_subcommand_from remote-ls remote-modify remote-delete" -a "(flatpak remote-list | string trim)"
+complete -f -c flatpak -n "__fish_seen_subcommand_from run" -a "(flatpak list --app | string trim | string match -r '^\S+')"
+complete -f -c flatpak -n "__fish_seen_subcommand_from info uninstall" -a "(flatpak list | string trim | string match -r '^\S+')"
+complete -f -c flatpak -n "__fish_seen_subcommand_from remote-ls remote-modify remote-delete" -a "(flatpak remote-list | string trim | string match -r '^\S+')"

 # Note that "remote-ls" opens an internet connection, so we don't want to complete "install"
 # Plenty of the other stuff is too free-form to complete (e.g. remote-add).
@zanchey zanchey added the completions label Oct 8, 2017
@zanchey zanchey added this to the fish-future milestone Oct 8, 2017
@TingPing
Copy link
Author

@TingPing TingPing commented Oct 8, 2017

That works as expected.

@mqudsi mqudsi closed this in 21473b2 Oct 9, 2017
@mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Oct 9, 2017

Thanks, @TingPing

This is fixed for fish3

@zanchey zanchey modified the milestones: fish-future, fish-3.0 Oct 9, 2017
@mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Oct 10, 2017

@zanchey do you want me to cherry-pick for 2.7.0?

@zanchey
Copy link
Member

@zanchey zanchey commented Oct 10, 2017

Yes please!

mqudsi added a commit that referenced this issue Oct 11, 2017
@mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Oct 11, 2017

Added to 2.7.0 and updated the changelog accordingly.

@mqudsi mqudsi modified the milestones: fish-3.0, fish 2.7.0 Oct 11, 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 pull requests

Successfully merging a pull request may close this issue.

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