From 74c2837d8764c191e2a735f5415300bb03ad8a73 Mon Sep 17 00:00:00 2001 From: JANMESH ARUN SHEWALE Date: Fri, 30 Jan 2026 17:23:50 +0530 Subject: [PATCH] dnf: support subcommand aliases in completions Closes #12393 --- localization/po/de.po | 3 --- localization/po/en.po | 3 --- localization/po/fr.po | 3 --- localization/po/pl.po | 3 --- localization/po/pt_BR.po | 3 --- localization/po/sv.po | 3 --- localization/po/zh_CN.po | 3 --- localization/po/zh_TW.po | 3 --- share/completions/dnf.fish | 26 ++++++++++++++++++-------- 9 files changed, 18 insertions(+), 32 deletions(-) diff --git a/localization/po/de.po b/localization/po/de.po index 4ad9235fc..a01f10c50 100644 --- a/localization/po/de.po +++ b/localization/po/de.po @@ -50044,9 +50044,6 @@ msgstr "" msgid "Removes the specified option for the named destination" msgstr "" -msgid "Removes the specified packages" -msgstr "" - msgid "Removes the specified service name from the service cache" msgstr "" diff --git a/localization/po/en.po b/localization/po/en.po index 5c2f2ab22..a7f1d2218 100644 --- a/localization/po/en.po +++ b/localization/po/en.po @@ -50042,9 +50042,6 @@ msgstr "" msgid "Removes the specified option for the named destination" msgstr "" -msgid "Removes the specified packages" -msgstr "" - msgid "Removes the specified service name from the service cache" msgstr "" diff --git a/localization/po/fr.po b/localization/po/fr.po index fc3deab42..269b6235a 100644 --- a/localization/po/fr.po +++ b/localization/po/fr.po @@ -50173,9 +50173,6 @@ msgstr "" msgid "Removes the specified option for the named destination" msgstr "" -msgid "Removes the specified packages" -msgstr "" - msgid "Removes the specified service name from the service cache" msgstr "" diff --git a/localization/po/pl.po b/localization/po/pl.po index 1e0ec12da..039819ca3 100644 --- a/localization/po/pl.po +++ b/localization/po/pl.po @@ -50038,9 +50038,6 @@ msgstr "" msgid "Removes the specified option for the named destination" msgstr "" -msgid "Removes the specified packages" -msgstr "" - msgid "Removes the specified service name from the service cache" msgstr "" diff --git a/localization/po/pt_BR.po b/localization/po/pt_BR.po index fa7b5d082..1d7184f09 100644 --- a/localization/po/pt_BR.po +++ b/localization/po/pt_BR.po @@ -50043,9 +50043,6 @@ msgstr "" msgid "Removes the specified option for the named destination" msgstr "" -msgid "Removes the specified packages" -msgstr "" - msgid "Removes the specified service name from the service cache" msgstr "" diff --git a/localization/po/sv.po b/localization/po/sv.po index 95a10537d..b30a87335 100644 --- a/localization/po/sv.po +++ b/localization/po/sv.po @@ -50039,9 +50039,6 @@ msgstr "" msgid "Removes the specified option for the named destination" msgstr "" -msgid "Removes the specified packages" -msgstr "" - msgid "Removes the specified service name from the service cache" msgstr "" diff --git a/localization/po/zh_CN.po b/localization/po/zh_CN.po index 9d0515d7d..ebc5f398b 100644 --- a/localization/po/zh_CN.po +++ b/localization/po/zh_CN.po @@ -50071,9 +50071,6 @@ msgstr "" msgid "Removes the specified option for the named destination" msgstr "" -msgid "Removes the specified packages" -msgstr "" - msgid "Removes the specified service name from the service cache" msgstr "" diff --git a/localization/po/zh_TW.po b/localization/po/zh_TW.po index 37bba7adf..503025fd8 100644 --- a/localization/po/zh_TW.po +++ b/localization/po/zh_TW.po @@ -50048,9 +50048,6 @@ msgstr "" msgid "Removes the specified option for the named destination" msgstr "" -msgid "Removes the specified packages" -msgstr "" - msgid "Removes the specified service name from the service cache" msgstr "" diff --git a/share/completions/dnf.fish b/share/completions/dnf.fish index 1e749909d..71b0154d3 100644 --- a/share/completions/dnf.fish +++ b/share/completions/dnf.fish @@ -51,6 +51,12 @@ function __dnf_list_transactions end end +# DNF subcommand aliases +set -l dnf_install_cmds install in +set -l dnf_remove_cmds remove rm +set -l dnf_reinstall_cmds reinstall rei +set -l dnf_info_cmds info if + # Alias complete -c dnf -n __fish_use_subcommand -xa alias -d "Manage aliases" complete -c dnf -n "__fish_seen_subcommand_from alias" -xa add -d "Add a new alias" @@ -127,12 +133,14 @@ for i in info redo rollback undo end # Info -complete -c dnf -n __fish_use_subcommand -xa info -d "Describes the given package" -complete -c dnf -n "__fish_seen_subcommand_from info; and not __fish_seen_subcommand_from history" -k -xa "(__dnf_list_available_packages)" +complete -c dnf -n __fish_use_subcommand -xa "$dnf_info_cmds" -d "Describes the given package" +complete -c dnf -n "__fish_seen_subcommand_from $dnf_info_cmds; and not __fish_seen_subcommand_from history" \ + -k -xa "(__dnf_list_available_packages)" # Install -complete -c dnf -n __fish_use_subcommand -xa install -d "Install package" -complete -c dnf -n "__fish_seen_subcommand_from install" -k -xa "(__dnf_list_available_packages)" +complete -c dnf -n __fish_use_subcommand -xa "$dnf_install_cmds" -d "Install package" +complete -c dnf -n "__fish_seen_subcommand_from $dnf_install_cmds" \ + -k -xa "(__dnf_list_available_packages)" # List complete -c dnf -n __fish_use_subcommand -xa list -d "Lists all packages" @@ -190,12 +198,14 @@ complete -c dnf -n "__fish_seen_subcommand_from offline-upgrade" -xa log -d "Sho complete -c dnf -n __fish_use_subcommand -xa provides -d "Finds packages providing the given command" # Reinstall -complete -c dnf -n __fish_use_subcommand -xa reinstall -d "Reinstalls a package" -complete -c dnf -n "__fish_seen_subcommand_from reinstall" -xa "(__dnf_list_installed_packages)" +complete -c dnf -n __fish_use_subcommand -xa "$dnf_reinstall_cmds" -d "Reinstalls a package" +complete -c dnf -n "__fish_seen_subcommand_from $dnf_reinstall_cmds" \ + -xa "(__dnf_list_installed_packages)" # Remove -complete -c dnf -n __fish_use_subcommand -xa remove -d "Remove packages" -complete -c dnf -n "__fish_seen_subcommand_from remove" -xa "(__dnf_list_installed_packages)" -d "Removes the specified packages" +complete -c dnf -n __fish_use_subcommand -xa "$dnf_remove_cmds" -d "Remove packages" +complete -c dnf -n "__fish_seen_subcommand_from $dnf_remove_cmds" \ + -xa "(__dnf_list_installed_packages)" complete -c dnf -n "__fish_seen_subcommand_from remove" -l duplicates -d "Removes older version of duplicated packages" complete -c dnf -n "__fish_seen_subcommand_from remove" -l oldinstallonly -d "Removes old installonly packages"