diff options
author | 2021-03-03 12:33:41 +0100 | |
---|---|---|
committer | 2021-03-03 12:33:41 +0100 | |
commit | eff12378dd671848e1ab7ead4403b4c64fd134da (patch) | |
tree | 7f59d8f0dd6a3f085d8cd4ed3375ca2405c9bc7a | |
parent | zsh-comp: order and sort (diff) | |
download | firejail-eff12378dd671848e1ab7ead4403b4c64fd134da.tar.gz firejail-eff12378dd671848e1ab7ead4403b4c64fd134da.tar.zst firejail-eff12378dd671848e1ab7ead4403b4c64fd134da.zip |
zsh-comp: make some options mutually exclusive
-rw-r--r-- | src/zsh_completion/_firejail.in | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/zsh_completion/_firejail.in b/src/zsh_completion/_firejail.in index 6d8ed3cfc..df5ac0138 100644 --- a/src/zsh_completion/_firejail.in +++ b/src/zsh_completion/_firejail.in | |||
@@ -1,5 +1,8 @@ | |||
1 | #compdef firejail | 1 | #compdef firejail |
2 | 2 | ||
3 | # Documentation: man 1 zshcompsys | ||
4 | # HowTo: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org | ||
5 | |||
3 | _all_firejails() { | 6 | _all_firejails() { |
4 | local -a _all_firejails_list | 7 | local -a _all_firejails_list |
5 | for jail in ${(f)"$(_call_program modules_tag "firejail --list 2> /dev/null | cut -d: -f1")"}; do | 8 | for jail in ${(f)"$(_call_program modules_tag "firejail --list 2> /dev/null | cut -d: -f1")"}; do |
@@ -37,8 +40,8 @@ _firejail_args=( | |||
37 | '--join=-[join the sandbox name|pid]: :_all_firejails' | 40 | '--join=-[join the sandbox name|pid]: :_all_firejails' |
38 | '--join-filesystem=-[join the mount namespace name|pid]: :_all_firejails' | 41 | '--join-filesystem=-[join the mount namespace name|pid]: :_all_firejails' |
39 | '--list[list all sandboxes]' | 42 | '--list[list all sandboxes]' |
40 | '--noprofile[do not use a security profile]' | 43 | '(--profile)--noprofile[do not use a security profile]' |
41 | '--profile=-[use a custom profile]: :_all_profiles' | 44 | '(--noprofile)--profile=-[use a custom profile]: :_all_profiles' |
42 | '--shutdown=-[shutdown the sandbox identified by name|pid]: :_all_firejails' | 45 | '--shutdown=-[shutdown the sandbox identified by name|pid]: :_all_firejails' |
43 | '--top[monitor the most CPU-intensive sandboxes]' | 46 | '--top[monitor the most CPU-intensive sandboxes]' |
44 | '--tree[print a tree of all sandboxed processes]' | 47 | '--tree[print a tree of all sandboxed processes]' |
@@ -106,7 +109,7 @@ _firejail_args=( | |||
106 | '--private-cwd[do not inherit working directory inside jail]' | 109 | '--private-cwd[do not inherit working directory inside jail]' |
107 | '--private-cwd=-[set working directory inside jail]: :_files -/' | 110 | '--private-cwd=-[set working directory inside jail]: :_files -/' |
108 | '--private-dev[create a new /dev directory with a small number of common device files]' | 111 | '--private-dev[create a new /dev directory with a small number of common device files]' |
109 | '*--private-etc=-[build a new /etc in a temporary filesystem, and copy the files and directories in the list]: :_files' | 112 | '(--writable-etc)--private-etc=-[build a new /etc in a temporary filesystem, and copy the files and directories in the list]: :_files' |
110 | '--private-opt=-[build a new /opt in a temporary filesystem]: :' | 113 | '--private-opt=-[build a new /opt in a temporary filesystem]: :' |
111 | '--private-srv=-[build a new /srv in a temporary filesystem]: :' | 114 | '--private-srv=-[build a new /srv in a temporary filesystem]: :' |
112 | '--private-tmp[mount a tmpfs on top of /tmp directory]' | 115 | '--private-tmp[mount a tmpfs on top of /tmp directory]' |
@@ -132,10 +135,10 @@ _firejail_args=( | |||
132 | '--shell=none[run the program directly without a user shell]' | 135 | '--shell=none[run the program directly without a user shell]' |
133 | '--shell=-[set default user shell]: :_files -g "*(*)"' | 136 | '--shell=-[set default user shell]: :_files -g "*(*)"' |
134 | '--timeout=-[kill the sandbox automatically after the time has elapsed]: :(hh\:mm\:ss)' | 137 | '--timeout=-[kill the sandbox automatically after the time has elapsed]: :(hh\:mm\:ss)' |
135 | '*--tmpfs=-[mount a tmpfs filesystem on directory dirname]: :_files -/' | 138 | #'(--tracelog)--trace[trace open, access and connect system calls]' |
136 | '--trace[trace open, access and connect system calls]' | 139 | '(--tracelog)--trace=-[trace open, access and connect system calls]: :_files' |
137 | '--tracelog[add a syslog message for every access to files or directories blacklisted by the security profile]' | 140 | '(--trace)--tracelog[add a syslog message for every access to files or directories blacklisted by the security profile]' |
138 | '--writable-etc[/etc directory is mounted read-write]' | 141 | '(--private-etc)--writable-etc[/etc directory is mounted read-write]' |
139 | '--writable-run-user[allow access to /run/user/$UID/systemd and /run/user/$UID/gnupg]' | 142 | '--writable-run-user[allow access to /run/user/$UID/systemd and /run/user/$UID/gnupg]' |
140 | '--writable-var[/var directory is mounted read-write]' | 143 | '--writable-var[/var directory is mounted read-write]' |
141 | '--writable-var-log[use the real /var/log directory, not a clone]' | 144 | '--writable-var-log[use the real /var/log directory, not a clone]' |
@@ -146,7 +149,7 @@ _firejail_args=( | |||
146 | #endif | 149 | #endif |
147 | 150 | ||
148 | #ifdef HAVE_CHROOT | 151 | #ifdef HAVE_CHROOT |
149 | '--chroot=-[chroot into directory]: :_files -/' | 152 | '(--noroot --overlay --overlay-named --overlay-tmpfs)--chroot=-[chroot into directory]: :_files -/' |
150 | #endif | 153 | #endif |
151 | 154 | ||
152 | #ifdef HAVE_DBUSPROXY | 155 | #ifdef HAVE_DBUSPROXY |
@@ -208,10 +211,10 @@ _firejail_args=( | |||
208 | #endif | 211 | #endif |
209 | 212 | ||
210 | #ifdef HAVE_OVERLAYFS | 213 | #ifdef HAVE_OVERLAYFS |
211 | '--overlay[mount a filesystem overlay on top of the current filesystem]' | 214 | '(--chroot --noroot)--overlay[mount a filesystem overlay on top of the current filesystem]' |
212 | '--overlay-clean[clean all overlays stored in $HOME/.firejail directory]' | 215 | '--overlay-clean[clean all overlays stored in $HOME/.firejail directory]' |
213 | '--overlay-named=-[mount a filesystem overlay on top of the current filesystem, and store it in name directory]: :_files -/' | 216 | '(--chroot --noroot)--overlay-named=-[mount a filesystem overlay on top of the current filesystem, and store it in name directory]: :_files -/' |
214 | '--overlay-tmpfs[mount a temporary filesystem overlay on top of the current filesystem]' | 217 | '(--chroot --noroot)--overlay-tmpfs[mount a temporary filesystem overlay on top of the current filesystem]' |
215 | #endif | 218 | #endif |
216 | 219 | ||
217 | #ifdef HAVE_PRIVATE_HOME | 220 | #ifdef HAVE_PRIVATE_HOME |
@@ -219,11 +222,12 @@ _firejail_args=( | |||
219 | #endif | 222 | #endif |
220 | 223 | ||
221 | #ifdef HAVE_USERNS | 224 | #ifdef HAVE_USERNS |
222 | '--noroot[install a user namespace with only the current user]' | 225 | '(--chroot --overlay --overlay-named --overlay-tmpfs)--noroot[install a user namespace with only the current user]' |
223 | #endif | 226 | #endif |
224 | 227 | ||
225 | #ifdef HAVE_USERTMPFS | 228 | #ifdef HAVE_USERTMPFS |
226 | '--private-cache[temporary ~/.cache directory]' | 229 | '--private-cache[temporary ~/.cache directory]' |
230 | '*--tmpfs=-[mount a tmpfs filesystem on directory dirname]: :_files -/' | ||
227 | #endif | 231 | #endif |
228 | 232 | ||
229 | #ifdef HAVE_WHITELIST | 233 | #ifdef HAVE_WHITELIST |
@@ -260,3 +264,5 @@ _firejail() { | |||
260 | ;; | 264 | ;; |
261 | esac | 265 | esac |
262 | } | 266 | } |
267 | |||
268 | # vim: ft=zsh sw=2 ts=2 et | ||