Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docker/fedora.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ FROM fedora:latest
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell

RUN dnf install --assumeyes \
cargo \
diffutils \
gcc-c++ \
git-core \
openssl \
pcre2-devel \
procps \
python3 \
python3-pip \
openssl \
procps \
sudo && \
rust \
sudo \
&& \
dnf clean all

RUN pip3 install pexpect
Expand Down
1 change: 0 additions & 1 deletion docker/opensuse-tumbleweed.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ENV LC_ALL=C.UTF-8
RUN zypper --non-interactive install \
bash \
diffutils \
gcc-c++ \
git-core \
pcre2-devel \
python311 \
Expand Down
42 changes: 21 additions & 21 deletions share/completions/dnf.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# Completions for the dnf command
#

function __dnf_is_dnf5
function __fish_dnf_is_dnf5
path resolve -- $PATH/dnf | path filter | string match -q -- '*/dnf5'
end

function __dnf_list_installed_packages
function __fish_dnf_list_installed_packages
dnf repoquery --cacheonly "$cur*" --qf "%{name}\n" --installed </dev/null
end

function __dnf_list_copr_repos
function __fish_dnf_list_copr_repos
set -l copr_repos (dnf copr list)

switch $argv[1]
Expand All @@ -23,7 +23,7 @@ function __dnf_list_copr_repos
end
end

function __dnf_list_available_packages
function __fish_dnf_list_available_packages
set -l tok (commandline -ct | string collect)
set -l files (__fish_complete_suffix .rpm)
if string match -q -- '*/*' $tok
Expand All @@ -32,7 +32,7 @@ function __dnf_list_available_packages
return
end
set -l results
if __dnf_is_dnf5
if __fish_dnf_is_dnf5
# dnf5 provides faster completions than repoquery, but does not maintain the
# same sqlite db as dnf4
set results (dnf --complete=2 dnf install "$tok*")
Expand All @@ -58,8 +58,8 @@ function __dnf_list_available_packages
string join \n $results
end

function __dnf_list_transactions
if not __dnf_is_dnf5 && type -q sqlite3
function __fish_dnf_list_transactions
if not __fish_dnf_is_dnf5 && type -q sqlite3
sqlite3 /var/lib/dnf/history.sqlite "SELECT id, cmdline FROM trans" 2>/dev/null | string replace "|" \t
end
end
Expand All @@ -78,7 +78,7 @@ complete -c dnf -n "__fish_seen_subcommand_from alias" -xa delete -d "Delete an

# Autoremove
complete -c dnf -n __fish_use_subcommand -xa autoremove -d "Removes unneeded packages"
complete -c dnf -n "__fish_seen_subcommand_from autoremove" -xa "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from autoremove" -xa "(__fish_dnf_list_installed_packages)"

# Check
complete -c dnf -n __fish_use_subcommand -xa check -d "Check for problems in packagedb"
Expand Down Expand Up @@ -110,15 +110,15 @@ complete -c dnf -n "__fish_seen_subcommand_from copr; and not __fish_seen_subcom
complete -c dnf -n "__fish_seen_subcommand_from copr; and not __fish_seen_subcommand_from $coprcommands" -l hub -d "Copr hub hostname"

for i in enable disable remove
complete -c dnf -n "__fish_seen_subcommand_from copr; and __fish_seen_subcommand_from $i" -xa "(__dnf_list_copr_repos $i)"
complete -c dnf -n "__fish_seen_subcommand_from copr; and __fish_seen_subcommand_from $i" -xa "(__fish_dnf_list_copr_repos $i)"
end

# Distro-sync
complete -c dnf -n __fish_use_subcommand -xa distro-sync -d "Synchronizes packages to match the latest"

# Downgrade
complete -c dnf -n __fish_use_subcommand -xa downgrade -d "Downgrades the specified package"
complete -c dnf -n "__fish_seen_subcommand_from downgrade" -xa "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from downgrade" -xa "(__fish_dnf_list_installed_packages)"

# Group
complete -c dnf -n __fish_use_subcommand -xa group -d "Manage groups"
Expand Down Expand Up @@ -156,18 +156,18 @@ complete -c dnf -n "__fish_seen_subcommand_from history" -xa undo -d "Undoes the
complete -c dnf -n "__fish_seen_subcommand_from history" -xa userinstalled -d "Lists all user installed packages"

for i in info redo rollback undo
complete -c dnf -n "__fish_seen_subcommand_from history; and __fish_seen_subcommand_from $i" -xa "(__dnf_list_transactions)"
complete -c dnf -n "__fish_seen_subcommand_from history; and __fish_seen_subcommand_from $i" -xa "(__fish_dnf_list_transactions)"
end

# Info
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)"
-k -xa "(__fish_dnf_list_available_packages)"

# Install
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)"
-k -xa "(__fish_dnf_list_available_packages)"

# List
complete -c dnf -n __fish_use_subcommand -xa list -d "Lists all packages"
Expand Down Expand Up @@ -227,12 +227,12 @@ complete -c dnf -n __fish_use_subcommand -xa provides -d "Finds packages providi
# Reinstall
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)"
-xa "(__fish_dnf_list_installed_packages)"

# Remove
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)"
-xa "(__fish_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"

Expand Down Expand Up @@ -340,28 +340,28 @@ complete -c dnf -n "__fish_seen_subcommand_from updateinfo" -l updates

# Upgrade
complete -c dnf -n __fish_use_subcommand -xa upgrade -d "Updates packages"
complete -c dnf -n "__fish_seen_subcommand_from upgrade" -xa "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from upgrade" -xa "(__fish_dnf_list_installed_packages)"

# Upgrade-Minimal
complete -c dnf -n __fish_use_subcommand -xa upgrade-minimal -d "Updates packages"
complete -c dnf -n "__fish_seen_subcommand_from upgrade-minimal" -xa "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from upgrade-minimal" -xa "(__fish_dnf_list_installed_packages)"

# Versionlock
if test -f /etc/dnf/plugins/versionlock.conf
function __dnf_current_versionlock_list
function __fish_dnf_current_versionlock_list
dnf versionlock list | grep -v metadata
end

complete -c dnf -n __fish_use_subcommand -xa versionlock -d "DNF versionlock plugin"
# - add
complete -c dnf -n "__fish_seen_subcommand_from versionlock" -xa add -d "Add a versionlock for all available packages matching the spec"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from add" -xa "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from add" -xa "(__fish_dnf_list_installed_packages)"
# - exclude
complete -c dnf -n "__fish_seen_subcommand_from versionlock" -xa exclude -d "Add an exclude (within versionlock) for the available packages matching the spec"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from exclude" -xa "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from exclude" -xa "(__fish_dnf_list_installed_packages)"
# - delete
complete -c dnf -n "__fish_seen_subcommand_from versionlock" -xa delete -d "Remove any matching versionlock entries"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from delete" -xa "(__dnf_current_versionlock_list)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from delete" -xa "(__fish_dnf_current_versionlock_list)"
# - list
complete -c dnf -n "__fish_seen_subcommand_from versionlock" -xa list -d "List the current versionlock entries"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from list" -xa "(false)"
Expand Down
2 changes: 1 addition & 1 deletion share/completions/fish_opt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ complete --command fish_opt --short-option h --long-option help --description 'S

complete --command fish_opt --short-option s --long-option short --no-files --require-parameter --description 'Specify short option'
complete --command fish_opt --short-option l --long-option long --no-files --require-parameter --description 'Specify long option'
complete --command fish_opt --long-option longonly --description 'Use only long option'
complete --command fish_opt --long-option long-only --description 'Use only long option'
complete --command fish_opt --short-option o --long-option optional-val -n $CONDITION --description 'Don\'t require value'
complete --command fish_opt --short-option r --long-option required-val -n $CONDITION --description 'Require value'
complete --command fish_opt --short-option m --long-option multiple-vals --description 'Store all values'
Expand Down
Loading