Skip to content

Commit c63b224

Browse files
crpbokdana
authored andcommitted
GitHub zsh-users#131: improve Debian and other completions
_apt: * fix: apt-config shell options + add missing options * new: satisy, autoremove, autpurge, --allow-downgrades, --allow-remove-essential,--allow-change-held-packages, --with-new-pkgs, indextargets, --snapshot/-S * snapshot lookup via mr/timestamp * edit-sources file lookup for .list & .sources _apt-file: add list-indices _bug: update bts backends from `reportbug --bts help` output _deb_architectures: update archs (source: popcon) _deb_files: add opt -D (.dsc) _debmany: complete _deb_packages aval _debsnap: complete _deb_packages avail _dhomepage: * NEW (complies to latest upstream version) https://salsa.debian.org/debian/debian-goodies/-/commit/1f9a8a771ba68e791ceb7c4821fbdaac78f4921b _dpkg: add missing options * add -raw-extract/-R, --ctrl-tarfile, --verify/-V, --clear-selections, --predep-package, --assert _dpkg-info: complete _deb_packages avail _fortune: complete databases _libvirt: * console should only work with running machines * add guestinfo to fast opts (w/o --domain) _losetup: remove "--delete" _madison: add missing options * add --url/-u, --noconf, --version * extend --component by non-free-firmware * add url-shorthand for table "all" _rsync: * add PROGRESS2 to --info _sbuild: * fix: --extra-package * change behaviour to allow options multiple times for --extra-package, --dpkg-source-opt[s] _schroot: * add --all-source-chroots, --exclude-aliases, --shell/-s, --option/-o, --automatic-session, --session-name/-n * extend shell lookup via /etc/shells _smartmontools: * add json option+arguments * update devicetypes arguments _wanna-build: remove (last seen in squeeze) _which-pkg-broke: complete _deb_packages avail _x_utils: add eventtype "button" _zfs: * added refreservation to delegatable permissions * fixed scriptname completion to only list filenames
1 parent 73c70ce commit c63b224

File tree

22 files changed

+156
-93
lines changed

22 files changed

+156
-93
lines changed

Completion/Debian/Command/_apt

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -417,19 +417,21 @@ _apt-cmd () {
417417
/$'(install|download|source|build-dep)\0'/ -'subcmd=${match%?}' \
418418
/$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=+-" "$expl_packages[@]" avail' \# \
419419
\( \
420-
// '%(.|)/%' -'[[ $subcmd = install ]]' /'[]'/ ':files: :_deb_files -c' \| \
420+
// '%(.|)/%' -'[[ $subcmd = install ]]' /'[]'/ ':files: :_deb_files' \| \
421+
// '%(.|)/%' -'[[ $subcmd = build-dep ]]' /'[]'/ ':files: :_deb_files -D' \| \
421422
/$'[^\0/=]#\/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \
422423
/$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \| \
423424
\) \
424425
\) \| \
425426
/$'((|auto)(remove|purge)|reinstall)\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
426427
/$'upgrade\0'/ \| \
427428
/$'autoclean\0'/ \| \
429+
/$'distclean\0'/ \| \
428430
/$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
429431
/$'full-upgrade\0'/ \| \
430432
/$'dist-upgrade\0'/ \| \
431-
/$'edit-sources\0'/ \| \
432-
/"[]"/ ':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install reinstall download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autopurge autoremove purge'
433+
/$'edit-sources\0'/ /$'[^\0]#\0'/ ':sourcefiles::_values 'sourcefiles' $sources ' \# \| \
434+
/"[]"/ ':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install reinstall download source build-dep satisfy remove upgrade full-upgrade dist-upgrade edit-sources autoclean distclean changelog autoremove autopurge purge'
433435

434436
_apt-cmd () {
435437
local expl_action expl_packages subcmd
@@ -458,7 +460,12 @@ _apt-get () {
458460
--no-download:bool \
459461
--no-install-recommends:bool \
460462
--ignore-hold:bool \
463+
--with-new-pkgs:bool \
461464
--no-upgrade:bool \
465+
--only-upgrade:bool \
466+
--allow-downgrades:bool \
467+
--allow-remove-essential:bool \
468+
--allow-change-held-packages:bool \
462469
--force-yes:bool \
463470
--print-uris:bool \
464471
--purge:bool \
@@ -475,27 +482,36 @@ _apt-get () {
475482
--arch-only:bool \
476483
--allow-unauthenticated:bool \
477484
--auto-remove:bool \
485+
-S,--snapshot:_snapshotdates \
478486
-- \
479487
/$'update\0'/ \| \
480488
/$'upgrade\0'/ \| \
481489
\( \
482-
/$'install\0'\|$'download\0'\|$'source\0'\|$'build-dep\0'/ \
483-
/$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=" "$expl_packages[@]" avail' \# \
490+
/$'(install|download|source|build-dep)\0'/ -'subcmd=${match%?}' \
491+
/$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=+-" "$expl_packages[@]" avail' \# \
484492
\( \
485-
/$'[^\0/=]#/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \
486-
/$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \
493+
// '%(.|)/%' -'[[ $subcmd = install ]]' /'[]'/ ':files: :_deb_files' \| \
494+
// '%(.|)/%' -'[[ $subcmd = build-dep ]]' /'[]'/ ':files: :_deb_files -D' \| \
495+
/$'[^\0/=]#\/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \
496+
/$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \| \
487497
\) \
488498
\) \| \
489499
/$'(|auto)(purge|remove)\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
490500
/$'dist-upgrade\0'/ \| \
491501
/$'dselect-upgrade\0'/ \| \
492502
/$'clean\0'/ \| \
503+
/$'clean\0'/ \| \
493504
/$'autoclean\0'/ \| \
505+
/$'indextargets\0'/ \| \
506+
/$'distclean\0'/ \| \
494507
/$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
495508
/$'check\0'/ \| \
496509
/$'help\0/' \| \
497510
/$'(|un)markauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
498-
/"[]"/ ':argument-1::compadd "$expl_action[@]" update upgrade install remove purge dist-upgrade dselect-upgrade clean autoclean changelog check source build-dep autopurge autoremove help markauto unmarkauto download'
511+
/$'autoremove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
512+
/$'autopurge\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
513+
/$'help\0/' \| \
514+
/"[]"/ ':argument-1::compadd "$expl_action[@]" update upgrade install reinstall remove purge dist-upgrade dselect-upgrade clean autoclean distclean changelog check source build-dep satisfy indextargets autoremove autopurge help markauto unmarkauto download'
499515

500516
_apt-get () {
501517
local expl_action expl_packages
@@ -589,15 +605,19 @@ _apt-cdrom () {
589605

590606
_apt-config () {
591607
_apt_arguments _apt-config \
608+
--empty:bool \
609+
--format:arbitem \
592610
-h,--help:bool \
593611
-v,--version:bool \
612+
--audit:bool \
594613
-c,--config-file:configfile \
595614
-o,--option:arbitem \
615+
--color:bool \
596616
-- \
597617
/$'shell\0'/ \
598618
\( \
599619
/$'[^\0]#\0'/ ':parameters:shell variable to assign:_parameters' \
600-
/$'[^\0]#\0'/ ':values:configuration key:compadd - ${${(f)"$(apt-config dump 2>&1)"}% *}' \
620+
/$'[^\0]#\0'/ ':values:configuration key:compadd - ${(u)${(f)"$(apt-config --empty --no-color --format='%f%n' dump 2>&1)"}%%(::|) *}' \
601621
\) \# \| \
602622
/$'dump\0'/ \| \
603623
/"[]"/ ':argument-1:action:compadd shell dump'
@@ -619,6 +639,14 @@ ${${${${(M)tmp:#*release*n=*}#*n=}%%,*}:#now}
619639
fi
620640
}
621641

642+
_apt_sources () {
643+
local sourcelist sourceparts diretc
644+
diretc="${"${"$(apt-config shell x dir::etc)"#*\'}"%\'*}"
645+
sourceparts="${"${"$(apt-config shell x dir::etc::sourceparts)"#*\'}"%\'*}"
646+
print /${diretc}/$sourceparts/*.{list,sources}(N:t)
647+
}
648+
sources=( $(_apt_sources) )
649+
622650
_apt_releases () {
623651
local update_policy
624652

@@ -707,4 +735,22 @@ _apt-mark () {
707735
_apt-mark "$@"
708736
}
709737

738+
_snapshotdates() {
739+
local expl
740+
local -a waybackdates
741+
742+
getdates() {
743+
whence -p python3 &>/dev/null || return 0
744+
local timespan='-6month'
745+
local timestamp="$(date +%Y%m%d --date="${timespan}")"
746+
local url="http://snapshot.debian.org/mr/timestamp/?archive=debian&after=${timestamp}"
747+
python3 -c 'import sys,urllib.request,json;[print(x) for x in json.loads(urllib.request.urlopen(sys.argv[1]).read())["result"]["debian"]]' "$url" 2>/dev/null || :
748+
}
749+
snapshotdates=(
750+
${(u)$(getdates)%T*}
751+
)
752+
_wanted list expl 'wayback date(s)' compadd ${expl} -- ${snapshotdates}
753+
}
754+
755+
710756
_apt "$@"

Completion/Debian/Command/_apt-file

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ case $state in
2828
'update:resynchronize package contents'
2929
{find,search}:'search in which package file is included'
3030
{list,show}:'list contents of a package'
31+
'list-indices:list the known content indices'
3132
'purge:remove all Contents-<ARCH>.gz files in cache directory'
3233
)
3334
_describe -t commands 'apt-list command' cmds
@@ -46,7 +47,7 @@ case $state in
4647
list|show)
4748
_deb_packages avail
4849
;;
49-
update|purge)
50+
update|purge|list-indices)
5051
# do nothing
5152
;;
5253
*)

Completion/Debian/Command/_bug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _bug_commonargs=(
1010
)
1111

1212
_rb_commonargs=(
13-
'(-B --bts)'{-B,--bts=}'[use alternate BTS]:system:(debian gnome kde tdyc kde-debian)'
13+
'(-B --bts)'{-B,--bts=}'[use alternate BTS]:system:(debian ubuntu guug default Grml)'
1414
'(-l --ldap)'{-l,--ldap}'[enable LDAP support]'
1515
'(-l --ldap)--no-ldap[disable LDAP support]'
1616
'(--proxy --http_proxy)'--{http_,}'proxy=:proxy host:_hosts'

Completion/Debian/Command/_debmany

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#compdef debmany
2+
3+
_deb_packages avail

Completion/Debian/Command/_debsnap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _arguments \
1010
'(-d --destdir)'{-d+,--destdir=}'[set download directory]:download directory:_files -/' \
1111
'(-f --force)'{-f,--force}'[allow non-empty destination directory]' \
1212
'(-v --verbose)'{-v,--verbose}'[print configuration and report progress]' \
13-
--list"[list versions; don't download]" \
13+
'(-l --list)'{-l,--list}"[list versions; don't download]" \
1414
--binary'[operate on binary packages (default: source packages)]' \
1515
'*'{-a+,--architecture=}'[specify architectures to download]:architecture to download:_deb_architectures' \
1616
--first='[download all versions newer than this]:version number (lower bound):->versions' \

Completion/Debian/Command/_dhomepage

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#compdef dhomepage
2+
3+
local arguments
4+
5+
arguments=(
6+
'(-v,--vcs)'{-v,--vcs}'[Open VCS-Homepage instead]'
7+
'(-e,--echo)'{-e,--echo}'[Only print the URL]'
8+
{-h,--help}'[Show help]'
9+
'--version[Show version information]'
10+
':package:_deb_packages avail'
11+
)
12+
13+
_arguments -S $arguments

Completion/Debian/Command/_dpkg

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ _dpkg_deb_only_actions=(
1919
_dpkg_deb_actions=(
2020
'(--build -b)'{--build,-b}'[build archive]:directory:_files -/'
2121
'(--contents -c)'{--contents,-c}'[list contents]: :_deb_files'
22-
'(--info -I)'{--info,-I}'[show info]: :_deb_files'
23-
'(--field -f)'{--field,-f}'[show fields]: :_deb_files'
2422
'(--control -e)'{--control,-e}'[extract control]: :_deb_files'
2523
'(--extract -x)'{--extract,-x}'[extract files]: :_deb_files'
2624
'(--vextract -X)'{--vextract,-X}'[extract and list files]: :_deb_files'
25+
'(--raw-extract -R)'{--raw-extract,-R}'[extracts files and control]: :_deb_files'
26+
'(--field -f)'{--field,-f}'[show fields]: :_deb_files'
2727
'--fsys-tarfile[output fs tarfile]: :_deb_files'
28+
'--ctrl-tarfile[output ctrl tarfile]: :_deb_files'
29+
'(--info -I)'{--info,-I}'[show info]: :_deb_files'
2830
)
2931

3032
_dpkg_common_actions=(
@@ -39,36 +41,43 @@ _dpkg_actions=(
3941
'--configure[reconfigure specified packages]:*:package:->configure'
4042
'(--remove -r)'{--remove,-r}'[remove package]:*:package:->remove'
4143
'(--purge -P)'{--purge,-P}'[purge package]:*:package:->purge'
44+
'(--verify -V)'{--verify,-V}'[verify package]:*:package:->verify'
45+
'(--audit -C)'{--audit,-C}'[check for broken pkgs]'
4246
'--update-avail[update available]:package file:_files'
4347
'--merge-avail[merge available]:package file:_files'
4448
'(--record-avail -A)'{--record-avail,-A}'[record available]:*:package files:->record_avail'
4549
'--forget-old-unavail[forget uninstalled unavailable]'
4650
'--clear-avail[clear available]'
47-
'(--audit -C)'{--audit,-C}'[check for broken pkgs]'
4851
'--get-selections[get selections]:pattern:'
4952
'--set-selections[set selections]'
53+
'--clear-selections[clear selections]'
5054
'--yet-to-unpack[list uninstalled]'
51-
'--print-architecture[print target architecture]'
52-
'--print-installation-architecture'
53-
'--print-foreign-architectures[print list of extra architectures]'
55+
'--predep-package[predep package]'
5456
'--add-architecture[add extra architecture]:architecture:->add_architecture'
5557
'--remove-architecture[remove extra architecture]:architecture:->remove_architecture'
58+
'--print-architecture[print target architecture]'
59+
'--print-foreign-architectures[print list of extra architectures]'
60+
'--assert--[assert feature]:what:(help support-predepends working-epoch long-filenames multi-conrep multi-arch versioned-provides protected-field)'
61+
'--validate--[validate thing]:what:(pkgname trigname archname version)'
5662
'--compare-versions[compare version numbers]:*::expression:= ->compare_versions'
5763
)
5864

5965
_dpkg_options=(
6066
'--abort-after[abort after errors]:number of errors:'
61-
'--root=[alternative root]:root:_files -/'
62-
'--instdir=[change inst root but not data dir]:_files -/'
63-
'(--selected-only -O)'{--selected-only,-O}'[skip unselected packages]'
64-
'(--skip-same-version -E)'{--skip-same-version,-E}'[skip packages with same version as installed]'
6567
'(--refuse-downgrade -G)'{--refuse-downgrade,-G}'[skip packages with earlier version than installed]'
6668
'(--auto-deconfigure -B)'{--auto-deconfigure,-B}'[install can break other packages]'
6769
'--no-act[show potential actions but do not follow through]'
6870
'-D+[debug options]:debug options:(h 1 2 3)'
6971
'--debug=[debug options]:debug options:(help 1 2 3)'
72+
--{force,refuse,no-force}'--[forcing options]:what:(all downgrade configure-any hold remove-reinstreq remove-protected remove-essential depends depends-version breaks conflicts confmiss confnew confold confdef confask overwrite overwrite-dir overwrite-diverted statoverride-add statoverride-remove security-mac unsafe-io script-chrootless architecture bad-version bad-path not-root bad-verify)'
7073
'--ignore-depends=[ignore depends involving package]:package:_deb_packages avail'
71-
--{force,refuse,no-force}'--[forcing options]:what:(all downgrade configure-any hold bad-path not-root overwrite overwrite-diverted bad-verify depends-version depends confnew confold confdef confmiss conflicts architecture overwrite-dir remove-reinstreq remove-essential help)'
74+
'--no-act[show potential actions but do not follow through]'
75+
'--dry-run[show potential actions but do not follow through]'
76+
'--simulate[show potential actions but do not follow through]'
77+
'--instdir=[change inst root but not data dir]:_files -/'
78+
'--root=[alternative root]:root:_files -/'
79+
'(--selected-only -O)'{--selected-only,-O}'[skip unselected packages]'
80+
'(--skip-same-version -E)'{--skip-same-version,-E}'[skip packages with same version as installed]'
7281
)
7382

7483
_dpkg_options_recursive=( '(--recursive -R)'{--recursive,-R}'[recursive]' )
@@ -82,11 +91,11 @@ _dpkg_deb_and_query_only_options=(
8291
)
8392

8493
_dpkg_query_actions=(
94+
'(--list -l)'{--list,-l}'[list packages]:*:packages:->list'
8595
'(--status -s)'{--status,-s}'[display package status]:*:packages:->status'
86-
'(--print-avail -p)'{--print-avail,-p}'[display available details]:packages:_deb_packages avail'
8796
'(--listfiles -L)'{--listfiles,-L}'[list owned files]:*:packages:->listfiles'
88-
'(--list -l)'{--list,-l}'[list packages]:*:packages:->list'
8997
'(--search -S)'{--search,-S}'[search for file owner]:*:pattern:->search'
98+
'(--print-avail -p)'{--print-avail,-p}'[display available details]:packages:_deb_packages avail'
9099
'--admindir=[data directory]:directory:_files -/'
91100
)
92101

@@ -147,7 +156,7 @@ case "$state" in
147156
- nonrecur \
148157
'*: :_deb_files'
149158
;;
150-
remove|status|listfiles)
159+
remove|status|listfiles|verify)
151160
_call_function ret _dpkg_$state && return ret
152161
_arguments -C -A "-*" -s "$_dpkg_options[@]" \
153162
'*:package:_deb_packages installed'

Completion/Debian/Command/_dpkg-info

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#compdef dpkg-info
2+
3+
_deb_packages avail

Completion/Debian/Command/_madison

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
_arguments \
44
'(-a --architecture)'{-a,--architecture=}':arch:_sequence _deb_architectures -a "all source" -' \
55
'(-b --binary)'{-b,--binary-type=}':type:(deb udeb)' \
6-
'(-c --component)'{-c,--component=}':component:_values -s , "component list" main contrib non-free' \
6+
'(-c --component)'{-c,--component=}':component:_values -s , "component list" main contrib non-free non-free-firmware' \
77
'(-g --greaterorequal)'{-g,--greaterorequal} \
88
'(-G --greaterthan)'{-G,--greaterthan} \
99
'(-h --help)'{-h,--help} \
10+
'(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" stable testing unstable oldstable oldoldstable' \
1011
'(-r --regex)'{-r,--regex} \
11-
'(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" oldstable stable testing unstable' \
1212
'(-S --source-and-binary)'{-S,--source-and-binary} \
13+
'(-u --url)'{-u,--url=}':url:_values -s , "url alias" debian new qa ubuntu all udd archive ports' \
14+
'--version' \
15+
'(--no-conf --noconf)'{--no-conf,--noconf} \
1316
'*:package:_deb_packages avail'
1417

Completion/Debian/Command/_sbuild

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ _sbuild_signing_keys() {
3333
}
3434

3535
_sbuild() {
36+
3637
_arguments \
3738
'(-h --help)'{-h,--help}'[show help message]' \
3839
'(-V --version)'{-V,--version}'[show version information]' \
@@ -67,8 +68,8 @@ _sbuild() {
6768
'(-j --jobs)'{-j=,--jobs=}'[jobs to run simultaneously]:number of jobs' \
6869
'--debbuildopt=[option to dpkg-buildpackage]:option' \
6970
'--debbuildopts=[options to dpkg-buildpackage]:options' \
70-
'--dpkg-source-opt=[option to dpkg-source]:option' \
71-
'--dpkg-source-opts=[options to dpkg-source]:options' \
71+
\*'--dpkg-source-opt=[option to dpkg-source]:option' \
72+
\*'--dpkg-source-opts=[options to dpkg-source]:options' \
7273
'--mail-log-to=[send log to mail]:recipient:_email_addresses -c' \
7374
'--mailfrom=[mail from]:sender:_email_addresses -c' \
7475
'(-n --nolog)'{-n,--nolog}'[no build log file]' \
@@ -124,7 +125,7 @@ _sbuild() {
124125
'--aspcud-criteria=[Optimization for aspcud]:criteria' \
125126
'(--resolve-alternatives --no-resolve-alternatives)--resolve-alternatives[allow alternatives in Build-Depends*]' \
126127
'(--resolve-alternatives --no-resolve-alternatives)--no-resolve-alternatives[disallow alternatives in Build-Depends*]' \
127-
'--extra-package=[make a package or directory available to the resolver]:package:_files -g "*deb(-.)"' \
128+
\*'--extra-package=[make a package or directory available to the resolver]:package:_files -g "*deb(-.)"' \
128129
'--extra-repository=[add a repository to the resolver]:url' \
129130
'--extra-repository-key=[add key to the resolver]:key:_files -g "*.asc(-.)"' \
130131
'--build-path=[place to build the package inside chroot]:path:_files -/' \

Completion/Debian/Command/_schroot

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,25 @@ _arguments -S \
99
'(-a --all)'{-a,--all}'[select all chroots and active sessions]' \
1010
'--all-chroots[select all chroots]' \
1111
'--all-sessions[select all active sessions]' \
12+
'--all-source-chroots[select all source chroots]' \
13+
'--exclude-aliases[do not include aliases]' \
1214
'*'{-c,--chroot=}'[use specified chroot]:chroot:->chroot' \
1315
'(-d --directory)'{-d,--directory=}'[directory to use]:dir:_files -W / -P /' \
1416
'(-u --user)'{-u,--user=}'[username (default current user)]:user:_users' \
17+
'(-s --shell)'{-s,--shell=}'[shell to use as login shell]:shell:->shells' \
1518
'(-l --list)'{-l,--list}'[list available chroots]' \
1619
'(-i --info)'{-i,--info}'[show information about selected chroots]' \
1720
'--location[print location of selected chroots]' \
1821
'--config[dump configuration of selected chroots]' \
1922
'(-p --preserve-environment)'{-p,--preserve-environment}'[preserve user environment]' \
23+
'(-o --option)'{-o,--option}'[set option]' \
2024
'(-q --quiet)'{-q,--quiet}'[quiet]' \
2125
'(-v --verbose)'{-v,--verbose}'[verbose]' \
2226
'(-V --version)'{-V,--version}'[version]' \
27+
'--automatic-session[begin, run and end a session automatically]' \
2328
'(-b --begin-session)'{-b,--begin-session}'[begin a session; returns a session ID]' \
2429
'(-r --run-session)'{-r,--run-session}'[run an existing session]' \
30+
'(-n --session-name)'{-n,--session-name}'[session name]' \
2531
'--recover-session[recover an existing session]' \
2632
'(-e --end-session)'{-e,--end-session}'[end an existing session]' \
2733
'(-f --force)'{-f,--force}'[force operation]' \
@@ -33,4 +39,8 @@ case "$state" in
3339
_wanted tag expl 'chroot' \
3440
compadd $(schroot -l -a)
3541
;;
42+
(shells)
43+
_wanted -C $context shells expl shell compadd ${(f)^"$(</etc/shells)"}(N)
44+
return
45+
;;
3646
esac

0 commit comments

Comments
 (0)