ps: Simplify completion

There are no non-option arguments here, so need
to parse. We can just complete from the available
options.

Closes: #2585
Approved by: alexlarsson
This commit is contained in:
Matthias Clasen
2019-01-13 11:36:06 -05:00
committed by Atomic Bot
parent 15f9bbf8c6
commit dd63d39da2

View File

@@ -172,24 +172,9 @@ flatpak_builtin_ps (int argc,
gboolean
flatpak_complete_ps (FlatpakCompletion *completion)
{
g_autoptr(GOptionContext) context = 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);
flatpak_complete_columns (completion, all_columns);
break;
default:
break;
}
flatpak_complete_options (completion, global_entries);
flatpak_complete_options (completion, options);
flatpak_complete_columns (completion, all_columns);
return TRUE;
}