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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@mqudsi

mqudsi Oct 8, 2017

Contributor

Can flatpack URLs contain spaces?

Contributor

mqudsi commented Oct 8, 2017

Can flatpack URLs contain spaces?

@TingPing

This comment has been minimized.

Show comment
Hide comment
@TingPing

TingPing Oct 8, 2017

An app-id cannot contain spaces.

TingPing commented Oct 8, 2017

An app-id cannot contain spaces.

@mqudsi

This comment has been minimized.

Show comment
Hide comment
@mqudsi

mqudsi Oct 8, 2017

Contributor

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).
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@TingPing

TingPing Oct 8, 2017

That works as expected.

TingPing commented Oct 8, 2017

That works as expected.

@mqudsi mqudsi closed this in 21473b2 Oct 9, 2017

@mqudsi

This comment has been minimized.

Show comment
Hide comment
@mqudsi

mqudsi Oct 9, 2017

Contributor

Thanks, @TingPing

This is fixed for fish3

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@mqudsi

mqudsi Oct 10, 2017

Contributor

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

Contributor

mqudsi commented Oct 10, 2017

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

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Oct 10, 2017

Member

Yes please!

Member

zanchey commented Oct 10, 2017

Yes please!

mqudsi added a commit that referenced this issue Oct 11, 2017

@mqudsi

This comment has been minimized.

Show comment
Hide comment
@mqudsi

mqudsi Oct 11, 2017

Contributor

Added to 2.7.0 and updated the changelog accordingly.

Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment