mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-29 20:35:12 -04:00
Add completion for --installation=
Complete all the things.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user