lamyer
(Lamy Geier)
December 15, 2024, 10:03am
1
Edit 2
$ type dnf
dnf is a function
dnf ()
{
if [[ "$1" == "search" ]]; then
command dnf -q -C search "${@:2}" | grep --color=auto -v 'i686';
else
if [[ "$1" == "info" ]] || [[ "$1" == "show" ]]; then
command dnf -q -C info "${@:2}";
else
command dnf -q -C "$@";
fi;
fi
}
dnf is /usr/bin/dnf
Edit 1
When I typed dnf insta
and press TAB key following is printed
$ dnf instaUnknown argument "--complete=1" for command "dnf5". Add "--help" for more information about the arguments.
When I typed command dnf inst
followed by TAB key:
$ command dnf instUnknown argument "--complete=1" for command "dnf5". Add "--help" for more information about the arguments.
Original
I typed Tab key after ./s
while typing in the following
$ sudo dnf install -y ./sUnknown argument "--complete=3" for command "dnf5". Add "--help" for more information about the arguments.
What gets printed - Unknown argument "--complete=3" for command "dnf5". Add "--help" for more information about the arguments.
barryascott
(Barry A Scott)
December 15, 2024, 10:33am
2
I cannot reproduce this problem.
I wonder if this depends on what files you have in the current directory?
What does ls "./s*"
list?
lamyer
(Lamy Geier)
December 15, 2024, 10:45am
3
When I typed dnf insta
and press TAB key following is printed
$ dnf instaUnknown argument "--complete=1" for command "dnf5". Add "--help" for more information about the arguments.
$ type dnf
dnf is a function
dnf ()
{
if [[ "$1" == "search" ]]; then
command dnf -q -C search "${@:2}" | grep --color=auto -v 'i686';
else
if [[ "$1" == "info" ]] || [[ "$1" == "show" ]]; then
command dnf -q -C info "${@:2}";
else
command dnf -q -C "$@";
fi;
fi
}
dnf is /usr/bin/dnf
When I typed command dnf inst
followed by TAB key:
$ command dnf instUnknown argument "--complete=1" for command "dnf5". Add "--help" for more information about the arguments.
barryascott
(Barry A Scott)
December 15, 2024, 3:44pm
4
It seems you have defined the dnf function yourself.
I do not have that function on my f41.
Seems you need to port the function to dnf5.
lamyer
(Lamy Geier)
December 15, 2024, 4:17pm
5
$ dnf --version
dnf5 version 5.2.8.1
dnf5 plugin API version 2.0
libdnf5 version 5.2.8.1
libdnf5 plugin API version 2.0
I am using dnf5 and the defined function is a simple function that should not affect the outcome.
vekruse
(Villy Kruse)
December 15, 2024, 5:12pm
6
The completion mechanism calls dnf inself to generate the completion using the exact command line
dnf --complete=1 dnf ins
With your wrapper function this becomes
dnf -q -C --complete=1 dnf ins
which is an error as the argument --complete=1
should be the very first argument to dnf to be recognized. This is documented only in the source code.
lamyer
(Lamy Geier)
December 15, 2024, 5:25pm
7
I tried the following, it seems to work
if [[ "$1" == "search" ]]; then
command dnf -q -C search "${@:2}" | grep -v 'i686'
elif [[ "$1" == "info" ]] || [[ "$1" == "show" ]]; then
command dnf -q -C info "${@:2}"
elif [[ "$1" =~ --complete* ]]; then
command dnf "$@"
else
command dnf -q -C "$@"
fi
What do you think? Is it fine?
vekruse
(Villy Kruse)
December 15, 2024, 6:40pm
8
The question should be: “Does it work?”. Thus test it to find out.
1 Like
ilikelinux
(ilikelinux)
December 16, 2024, 12:48am
9
We had the question lately for the zsh shell and found out that It is not dnf5 ready alias based still on dnf4. Is it ready for bash?
Otherwise this would be an other source of failures/incompatibility.
Topic mentioned is here:
How to get dnf auto completion in zsh