- Implemented a new CLI using Clap for managing Fedora configurations and packages. - Added commands for configuring dnf, adding repositories, installing RPM Fusion, adding users to groups, and managing packages. - Created data files for various package lists (AMD, Intel, common, firmware, gnome extra) and user groups. - Introduced Zsh completion script for improved command-line usability. - Removed the old CLI implementation and integrated the new structure into the main application logic.
94 lines
10 KiB
Fish
94 lines
10 KiB
Fish
# Print an optspec for argparse to handle cmd's options that are independent of any subcommand.
|
|
function __fish_feddy_global_optspecs
|
|
string join \n generate= h/help V/version
|
|
end
|
|
|
|
function __fish_feddy_needs_command
|
|
# Figure out if the current invocation already has a command.
|
|
set -l cmd (commandline -opc)
|
|
set -e cmd[1]
|
|
argparse -s (__fish_feddy_global_optspecs) -- $cmd 2>/dev/null
|
|
or return
|
|
if set -q argv[1]
|
|
# Also print the command, so this can be used to figure out what it is.
|
|
echo $argv[1]
|
|
return 1
|
|
end
|
|
return 0
|
|
end
|
|
|
|
function __fish_feddy_using_subcommand
|
|
set -l cmd (__fish_feddy_needs_command)
|
|
test -z "$cmd"
|
|
and return 1
|
|
contains -- $cmd[1] $argv
|
|
end
|
|
|
|
complete -c feddy -n "__fish_feddy_needs_command" -l generate -r -f -a "bash\t''
|
|
elvish\t''
|
|
fish\t''
|
|
powershell\t''
|
|
zsh\t''"
|
|
complete -c feddy -n "__fish_feddy_needs_command" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_needs_command" -s V -l version -d 'Print version'
|
|
complete -c feddy -n "__fish_feddy_needs_command" -f -a "configure-dnf" -d 'Configure dnf'
|
|
complete -c feddy -n "__fish_feddy_needs_command" -f -a "add-repo" -d 'Add a repository'
|
|
complete -c feddy -n "__fish_feddy_needs_command" -f -a "install-rpm-fusion" -d 'Install RPM fusion'
|
|
complete -c feddy -n "__fish_feddy_needs_command" -f -a "add-user-to-groups" -d 'Add user to groups'
|
|
complete -c feddy -n "__fish_feddy_needs_command" -f -a "package" -d 'Manage packages'
|
|
complete -c feddy -n "__fish_feddy_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand configure-dnf" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and not __fish_seen_subcommand_from vscode mullvad vivaldi help" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and not __fish_seen_subcommand_from vscode mullvad vivaldi help" -f -a "vscode" -d 'Add VSCode repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and not __fish_seen_subcommand_from vscode mullvad vivaldi help" -f -a "mullvad" -d 'Add Mullvad repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and not __fish_seen_subcommand_from vscode mullvad vivaldi help" -f -a "vivaldi" -d 'Add Vivaldi repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and not __fish_seen_subcommand_from vscode mullvad vivaldi help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and __fish_seen_subcommand_from vscode" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and __fish_seen_subcommand_from mullvad" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and __fish_seen_subcommand_from vivaldi" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and __fish_seen_subcommand_from help" -f -a "vscode" -d 'Add VSCode repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and __fish_seen_subcommand_from help" -f -a "mullvad" -d 'Add Mullvad repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and __fish_seen_subcommand_from help" -f -a "vivaldi" -d 'Add Vivaldi repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-repo; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand install-rpm-fusion" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-user-to-groups" -s u -l user -r
|
|
complete -c feddy -n "__fish_feddy_using_subcommand add-user-to-groups" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -s r -l remove
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -f -a "common-list" -d 'Install/Remove the common list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -f -a "amd-list" -d 'Install/Remove the AMD list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -f -a "intel-list" -d 'Install/Remove the Intel list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -f -a "gnome-extra-list" -d 'Install/Remove the Gnome extra list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -f -a "firmware-list" -d 'Install/Remove the firmware list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -f -a "custom-list" -d 'Install/Remove a custom list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and not __fish_seen_subcommand_from common-list amd-list intel-list gnome-extra-list firmware-list custom-list help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from common-list" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from amd-list" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from intel-list" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from gnome-extra-list" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from firmware-list" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from custom-list" -s f -l file -r
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from custom-list" -s h -l help -d 'Print help'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from help" -f -a "common-list" -d 'Install/Remove the common list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from help" -f -a "amd-list" -d 'Install/Remove the AMD list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from help" -f -a "intel-list" -d 'Install/Remove the Intel list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from help" -f -a "gnome-extra-list" -d 'Install/Remove the Gnome extra list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from help" -f -a "firmware-list" -d 'Install/Remove the firmware list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from help" -f -a "custom-list" -d 'Install/Remove a custom list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand package; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and not __fish_seen_subcommand_from configure-dnf add-repo install-rpm-fusion add-user-to-groups package help" -f -a "configure-dnf" -d 'Configure dnf'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and not __fish_seen_subcommand_from configure-dnf add-repo install-rpm-fusion add-user-to-groups package help" -f -a "add-repo" -d 'Add a repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and not __fish_seen_subcommand_from configure-dnf add-repo install-rpm-fusion add-user-to-groups package help" -f -a "install-rpm-fusion" -d 'Install RPM fusion'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and not __fish_seen_subcommand_from configure-dnf add-repo install-rpm-fusion add-user-to-groups package help" -f -a "add-user-to-groups" -d 'Add user to groups'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and not __fish_seen_subcommand_from configure-dnf add-repo install-rpm-fusion add-user-to-groups package help" -f -a "package" -d 'Manage packages'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and not __fish_seen_subcommand_from configure-dnf add-repo install-rpm-fusion add-user-to-groups package help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from add-repo" -f -a "vscode" -d 'Add VSCode repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from add-repo" -f -a "mullvad" -d 'Add Mullvad repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from add-repo" -f -a "vivaldi" -d 'Add Vivaldi repository'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from package" -f -a "common-list" -d 'Install/Remove the common list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from package" -f -a "amd-list" -d 'Install/Remove the AMD list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from package" -f -a "intel-list" -d 'Install/Remove the Intel list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from package" -f -a "gnome-extra-list" -d 'Install/Remove the Gnome extra list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from package" -f -a "firmware-list" -d 'Install/Remove the firmware list'
|
|
complete -c feddy -n "__fish_feddy_using_subcommand help; and __fish_seen_subcommand_from package" -f -a "custom-list" -d 'Install/Remove a custom list'
|