Skip to content

Commit

Permalink
fix(iperf,puppet): use \{m,n\} instead of \? and \+ for POSIX sed
Browse files Browse the repository at this point in the history
\? and \+ in BRE are GNU extensions.
  • Loading branch information
akinomyoga committed Nov 28, 2023
1 parent 979f04f commit 3f0322b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions completions/iperf
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ _comp_cmd_iperf()
for i in "${words[@]}"; do
case $i in
-s | --server)
filter=(command sed -e '/^Client.specific/,/^\(Server.specific.*\)\?$/d')
filter=(command sed -e '/^Client.specific/,/^\(Server.specific.*\)\{0,1\}$/d')
;;
-c | --client)
filter=(command sed -e '/^Server.specific/,/^\(Client.specific.*\)\?$/d')
filter=(command sed -e '/^Server.specific/,/^\(Client.specific.*\)\{0,1\}$/d')
;;
esac
done
Expand Down
2 changes: 1 addition & 1 deletion completions/puppet
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ _comp_cmd_puppet__certs()
if [[ $1 == --all ]]; then
cert_list=$(
$puppetca --list --all |
command sed -e 's/^[+-]\{0,1\}\s*\(\S\+\)\s\+.*$/\1/'
command sed -e 's/^[+-]\{0,1\}\s*\(\S\{1,\}\)\s\{1,\}.*$/\1/'
)
else
cert_list=$("$puppetca" --list)
Expand Down
2 changes: 1 addition & 1 deletion test/update-test-cmd-list
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ mydir=$(
cat "$mydir"/t/test_*.py |
tr -d '\n' |
grep -Eo '@pytest.mark.complete\(([^)]*\<require_(cmd|longopt) *= *True\>[^)]*)\)' |
sed -ne 's/^[^"]*"\\\?\([^_][^[:space:]"]*\)[[:space:]"].*/\1/p' |
sed -ne 's/^[^"]*"\\\{0,1\}\([^_][^[:space:]"]*\)[[:space:]"].*/\1/p' |
LC_ALL=C sort -u \
>"$mydir"/test-cmd-list.txt

0 comments on commit 3f0322b

Please sign in to comment.