diff options
author | Matthew Leeds <matthew.leeds@endlessm.com> | 2018-11-15 23:02:50 -0800 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-11-17 13:00:33 +0000 |
commit | 5fe2a0aabe73d9c88da99b16b9a2074cfae6b570 (patch) | |
tree | 0e0e7bdb2ad09fa5ea1a6c699ee7dfb1b17d68f8 /app/flatpak-builtins-info.c | |
parent | 7d35de18e46f1629c89d0f74d2ea0ef723814009 (diff) | |
download | flatpak-5fe2a0aabe73d9c88da99b16b9a2074cfae6b570.tar.gz |
uninstall: Add support for fuzzy matching
This adds support for fuzzy matching ref names (AKA "typo helper") to
the uninstall command to mirror what the install command has. In short,
this means you can do "flatpak uninstall gedit" instead of "flatpak
uninstall org.gnome.gedit". Flatpak will prompt you to choose between
similarly named installed refs, and will only make the choice for you if
--assumeyes was used and there's only one match.
Note that this commit does have the side effect that if there are
multiple matching refs with the same ID (e.g. with different branches or
in different installations) you are prompted to choose between them.
Previously you were shown an error message.
Closes: #2330
Approved by: matthiasclasen
Diffstat (limited to 'app/flatpak-builtins-info.c')
-rw-r--r-- | app/flatpak-builtins-info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/flatpak-builtins-info.c b/app/flatpak-builtins-info.c index 7bc6b855..3ee0c7df 100644 --- a/app/flatpak-builtins-info.c +++ b/app/flatpak-builtins-info.c @@ -454,7 +454,7 @@ flatpak_complete_info (FlatpakCompletion *completion) { FlatpakDir *dir = g_ptr_array_index (dirs, i); g_auto(GStrv) refs = flatpak_dir_find_installed_refs (dir, NULL, NULL, opt_arch, - kinds, &error); + kinds, FIND_MATCHING_REFS_FLAGS_NONE, &error); if (refs == NULL) flatpak_completion_debug ("find local refs error: %s", error->message); for (j = 0; refs != NULL && refs[j] != NULL; j++) @@ -471,7 +471,7 @@ flatpak_complete_info (FlatpakCompletion *completion) { FlatpakDir *dir = g_ptr_array_index (dirs, i); g_auto(GStrv) refs = flatpak_dir_find_installed_refs (dir, completion->argv[1], NULL, opt_arch, - kinds, &error); + kinds, FIND_MATCHING_REFS_FLAGS_NONE, &error); if (refs == NULL) flatpak_completion_debug ("find remote refs error: %s", error->message); for (j = 0; refs != NULL && refs[j] != NULL; j++) |