mirror of
https://github.com/flatpak/flatpak.git
synced 2026-02-01 03:21:23 -05:00
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:
committed by
Atomic Bot
parent
15f9bbf8c6
commit
dd63d39da2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user