Skip to content

Commit

Permalink
Fix bash-completion to work with right adjusted numbers in the 1st co…
Browse files Browse the repository at this point in the history
…lumn too (closes #505)
  • Loading branch information
mlandres committed Jan 23, 2024
1 parent 4dee216 commit 5a754be
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bash-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,26 +130,26 @@ _zypper() {
;;
removerepo | rr | modifyrepo | mr | renamerepo | nr | refresh | ref)
opts=(${opts[@]}$(echo; LC_ALL=POSIX $ZYPPER -q lr | \
sed -rn '/^[0-9]/{
s/^[0-9]+[[:blank:]]*\|[[:blank:]]*([^|]+).*/\1/
sed -rn '/^[[:blank:]]*[0-9]/{
s/^[[:blank:]]*[0-9]+[[:blank:]]*\|[[:blank:]]*([^|]+).*/\1/
s/[[:blank:]]*$//
/^$/d
p
}'))
;;
addservice | as | modifyservice | ms | removeservice | rs)
opts=(${opts[@]}$(echo; LC_ALL=POSIX $ZYPPER -q ls | \
sed -rn '/^[0-9]/{
s/^[0-9]+[[:blank:]]*\|[[:blank:]]*([^|]+).*/\1/
sed -rn '/^[[:blank:]]*[0-9]/{
s/^[[:blank:]]*[0-9]+[[:blank:]]*\|[[:blank:]]*([^|]+).*/\1/
s/[[:blank:]]*$//
/^$/d
p
}'))
;;
removelock | rl)
opts=(${opts[@]}$(echo; LC_ALL=POSIX $ZYPPER -q ll | \
sed -rn '/^[0-9]/{
s/^[0-9]+[[:blank:]]*\|[[:blank:]]*([^|]+).*/\1/p
sed -rn '/^[[:blank:]]*[0-9]/{
s/^[[:blank:]]*[0-9]+[[:blank:]]*\|[[:blank:]]*([^|]+).*/\1/p
s/[[:blank:]]*$//
/^$/d
p
Expand Down

0 comments on commit 5a754be

Please sign in to comment.