From 084b518c4e7fb58352913fa87265a6341d6d7e8e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 30 Dec 2018 12:59:24 -0500 Subject: [PATCH] Add completion for --installation= Complete all the things. --- app/flatpak-complete.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/flatpak-complete.c b/app/flatpak-complete.c index 87b15505..76aab667 100644 --- a/app/flatpak-complete.c +++ b/app/flatpak-complete.c @@ -21,6 +21,7 @@ #include "config.h" #include "flatpak-complete.h" +#include "flatpak-installation.h" #include "flatpak-utils-private.h" /* Uncomment to get debug traces in /tmp/flatpak-completion-debug.txt (nice @@ -343,6 +344,16 @@ flatpak_complete_options (FlatpakCompletion *completion, { flatpak_complete_file (completion, "__FLATPAK_FILE"); } + else if (strcmp (e->long_name, "installation") == 0) + { + g_autoptr(GPtrArray) installations = NULL; + installations = flatpak_get_system_installations (NULL, NULL); + for (i = 0; i < installations->len; i++) + { + FlatpakInstallation *inst = g_ptr_array_index (installations, i); + flatpak_complete_word (completion, "%s%s ", prefix, flatpak_installation_get_id (inst)); + } + } else flatpak_complete_word (completion, "%s", prefix); }