flatpak enter: Add completion

This was the last command without completion, so we're complete!
This commit is contained in:
Matthias Clasen committed 2016-06-10 01:09:51 -04:00
1 parent de967dfb5b
commit 0d2b3ec5d0
2 files changed
+26 -1

No files matched your search

+25
View File
@@ -271,3 +271,28 @@ flatpak_builtin_enter (int argc,
exit (status);
}
gboolean
flatpak_complete_enter (FlatpakCompletion *completion)
{
g_autoptr(GOptionContext) context = NULL;
g_autoptr(GError) error = NULL;
context = g_option_context_new ("");
if (!flatpak_option_context_parse (context, options, &completion->argc, &completion->argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, NULL, NULL))
return FALSE;
switch (completion->argc)
{
case 0:
case 1:
flatpak_complete_options (completion, global_entries);
flatpak_complete_options (completion, options);
break;
default:
break;
}
return TRUE;
}
+1 -1
View File
@@ -63,7 +63,7 @@ static FlatpakCommand commands[] = {
{ "override", "Override permissions for an application", flatpak_builtin_override, flatpak_complete_override },
{ "export-file", "Grant an application access to a specific file", flatpak_builtin_export_file, flatpak_complete_export_file },
{ "make-current", "Specify default version to run", flatpak_builtin_make_current_app, flatpak_complete_make_current_app },
{ "enter", "Enter the namespace of a running application", flatpak_builtin_enter },
{ "enter", "Enter the namespace of a running application", flatpak_builtin_enter, flatpak_complete_enter },
{ "\n Manage remote repositories" },
{ "remote-add", "Add a new remote repository (by URL)", flatpak_builtin_add_remote, flatpak_complete_add_remote },