Skip to content

Commit b31c0f9

Browse files
committed
*: Trivial cleanups
1 parent 8611927 commit b31c0f9

30 files changed

+89
-68
lines changed

completions/_su

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ _su() # linux-specific completion
3535
fi
3636

3737
COMPREPLY=( $( compgen -u -- "$cur" ) )
38-
} && complete -F _su su
38+
} &&
39+
complete -F _su su
3940

4041
# ex: ts=4 sw=4 et filetype=sh

completions/abook

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ _abook()
2323
case $prev in
2424
--informat)
2525
COMPREPLY=( $( compgen -W "$($1 --formats | \
26-
command sed -n -e 's/^'$'\t''\([a-z]*\).*/\1/p' -e '/^$/q')" -- "$cur" ) )
26+
command sed -n -e 's/^'$'\t''\([a-z]*\).*/\1/p' -e '/^$/q')" \
27+
-- "$cur" ) )
2728
;;
2829
--outformat)
2930
COMPREPLY=( $( compgen -W "$($1 --formats | \
30-
command sed -n -e '/^$/,$s/^'$'\t''\([a-z]*\).*/\1/p')" -- "$cur" ) )
31+
command sed -n -e '/^$/,$s/^'$'\t''\([a-z]*\).*/\1/p')" \
32+
-- "$cur" ) )
3133
;;
3234
--infile)
3335
COMPREPLY=( $( compgen -W stdin -- "$cur" ) )

completions/bts

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
# List bug numbers from bugs cache in ~/.devscripts_cache/bts
44
_cached_bugs() {
55
[[ -d $HOME/.devscripts_cache/bts ]] && \
6-
find $HOME/.devscripts_cache/bts -maxdepth 1 -name "$cur[0-9]*.html" -printf "%f\n" | cut -d'.' -f1
6+
find $HOME/.devscripts_cache/bts -maxdepth 1 -name "$cur[0-9]*.html" \
7+
-printf "%f\n" | cut -d'.' -f1
78
}
89

910
# List APT source packages prefixed with "src:"
1011
_src_packages_with_prefix() {
1112
ppn=${cur:4} # partial package name, after stripping "src:"
12-
compgen -P "src:" -W '$( _xfunc apt-cache _apt_cache_sources "$ppn" )' -- "$ppn"
13+
compgen -P "src:" -W '$( _xfunc apt-cache _apt_cache_sources "$ppn" )' \
14+
-- "$ppn"
1315
}
1416

1517

@@ -21,29 +23,33 @@ _bts()
2123
case $prev in
2224
show|bugs)
2325
COMPREPLY=( $( compgen -W 'release-critical RC from: tag:
24-
usertag:' -- "$cur" ) $( _cached_bugs ) $( _src_packages_with_prefix ) )
26+
usertag:' -- "$cur" ) $( _cached_bugs )
27+
$( _src_packages_with_prefix ) )
2528
return
2629
;;
2730
select)
28-
COMPREPLY=( $( compgen -W 'package: source: maintainer: submitter: severity: status: tag:
29-
owner: correspondent: affects: bugs: users: archive:' -- "$cur" ) )
31+
COMPREPLY=( $( compgen -W 'package: source: maintainer: submitter:
32+
severity: status: tag: owner: correspondent: affects: bugs:
33+
users: archive:' -- "$cur" ) )
3034
return
3135
;;
3236
status)
33-
COMPREPLY=( $( compgen -W 'file: fields: verbose' -- "$cur" ) $( _cached_bugs ) )
37+
COMPREPLY=( $( compgen -W 'file: fields: verbose' -- "$cur" )
38+
$( _cached_bugs ) )
3439
return
3540
;;
3641
block|unblock)
3742
COMPREPLY=( $( compgen -W 'by with' -- "$cur" ) )
3843
return
3944
;;
4045
severity)
41-
COMPREPLY=( $( compgen -W 'wishlist minor normal important serious grave critical' -- "$cur" ) )
46+
COMPREPLY=( $( compgen -W 'wishlist minor normal important serious
47+
grave critical' -- "$cur" ) )
4248
return
4349
;;
4450
limit)
45-
COMPREPLY=( $( compgen -W 'submitter date subject msgid package source tag severity owner
46-
affects archive' -- "$cur" ) )
51+
COMPREPLY=( $( compgen -W 'submitter date subject msgid package
52+
source tag severity owner affects archive' -- "$cur" ) )
4753
return
4854
;;
4955
clone|done|reopen|archive|unarchive|retitle|summary|submitter|found\
@@ -59,13 +65,15 @@ _bts()
5965
return
6066
;;
6167
cache)
62-
COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) $( _src_packages_with_prefix )
63-
$( compgen -W 'from: release-critical RC' -- "$cur" ))
68+
COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages )
69+
$( _src_packages_with_prefix )
70+
$( compgen -W 'from: release-critical RC' -- "$cur" ) )
6471
return
6572
;;
6673
cleancache)
67-
COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) $( _src_packages_with_prefix )
68-
$( compgen -W 'from: tag: usertag: ALL' -- "$cur" ))
74+
COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages )
75+
$( _src_packages_with_prefix )
76+
$( compgen -W 'from: tag: usertag: ALL' -- "$cur" ) )
6977
return
7078
;;
7179
user)
@@ -84,7 +92,6 @@ _bts()
8492
;;
8593
esac
8694

87-
8895
$split && return
8996

9097
COMPREPLY=( $( compgen -W '--offline --online --no-offline

completions/dict

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ _dict()
3030
[[ -n $db ]] && host="-d $db"
3131
i=$((++i))
3232
;;
33-
*)
34-
;;
3533
esac
3634
done
3735

@@ -49,8 +47,6 @@ _dict()
4947
COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) )
5048
return
5149
;;
52-
*)
53-
;;
5450
esac
5551

5652
local dictfile=/usr/share/dict/words

completions/dpkg

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,16 @@ _dpkg_reconfigure()
9898

9999
case $prev in
100100
-f|--frontend)
101-
opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) )
102-
opt=( ${opt[@]##*/} )
103-
opt=( ${opt[@]%.pm} )
104-
COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) )
105-
return
106-
;;
101+
opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) )
102+
opt=( ${opt[@]##*/} )
103+
opt=( ${opt[@]%.pm} )
104+
COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) )
105+
return
106+
;;
107107
-p|--priority)
108-
COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) )
109-
return
110-
;;
108+
COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) )
109+
return
110+
;;
111111
esac
112112

113113
if [[ "$cur" == -* ]]; then

completions/dpkg-source

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ _dpkg_source()
8181
COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) )
8282
;;
8383
*)
84-
COMPREPLY=( $( compgen -W "$packopts $unpackopts" -- "$cur" ) )
84+
COMPREPLY=( $( compgen -W "$packopts $unpackopts" \
85+
-- "$cur" ) )
8586
;;
8687
esac
8788
return

completions/fbgs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ _fbgs()
4444
fi
4545

4646
_filedir '?(e)ps|pdf'
47-
} && complete -F _fbgs fbgs
47+
} &&
48+
complete -F _fbgs fbgs
4849

4950
# ex: ts=4 sw=4 et filetype=sh

completions/fbi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ _fbi()
4848
# FIXME: It is hard to determine correct supported extensions.
4949
# fbi can handle any format that imagemagick can plus some others
5050
_filedir 'bmp|gif|jp?(e)g|pcd|png|p[pgb]m|tif?(f)|webp|xpm|xwd|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf'
51-
} && complete -F _fbi fbi
51+
} &&
52+
complete -F _fbi fbi
5253

5354
# ex: ts=4 sw=4 et filetype=sh

completions/feh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ _feh()
109109
# FIXME: It is hard to determine correct supported extensions.
110110
# feh can handle any format that imagemagick can plus some others
111111
_filedir 'xpm|tif?(f)|png|p[npgba]m|iff|?(i)lbm|jp?(e)g|jfi?(f)|gif|bmp|arg?(b)|tga|xcf|ani|ico|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf'
112-
} && complete -F _feh feh
112+
} &&
113+
complete -F _feh feh
113114

114115
# ex: ts=4 sw=4 et filetype=sh

completions/htop

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ _htop()
2727
[[ $COMPREPLY == *= ]] && compopt -o nospace
2828
return
2929
fi
30-
} && complete -F _htop htop
30+
} &&
31+
complete -F _htop htop
3132

3233
# ex: ts=4 sw=4 et filetype=sh

0 commit comments

Comments
 (0)