summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorMaanya Goenka <t-magoenka@microsoft.com>2021-06-30 09:57:54 -0700
committerMaanya Goenka <t-magoenka@microsoft.com>2021-08-10 02:41:12 -0700
commit2a7cf953e1f5372ccbabed02208de989d396ae51 (patch)
tree80f00397435e88701af61bc99dcd8dd95e23f6e0 /shell-completion
parent782671bc8f580835a917ac712fe6dc0d17205bd5 (diff)
downloadsystemd-2a7cf953e1f5372ccbabed02208de989d396ae51.tar.gz
systemd-analyze: add --root option for 'verify' verb and allow path parsing
------------------------------------------------------------------------------- Example Run: foobar.service created below is a service unit file that has a non-existing key-value pairing (foo = bar) and is thus, syntactically invalid. maanya-goenka@debian:~/systemd (img-support)$ cat <<EOF>img/usr/lib/systemd/system/foobar.service > [Unit] > foo = bar > > [Service] > ExecStart = /opt/script0.sh > EOF The failure to create foobar.service because of the recursive dependency searching and verification has been addressed in a different PR: systemd-analyze: add option to return an error value when unit verification fails #20233 maanya-goenka@debian:~/systemd (img-support)$ sudo build/systemd-analyze verify --root=img/ foobar.service /home/maanya-goenka/systemd/img/usr/lib/systemd/system/foobar.service:2: Unknown key name 'foo' in section 'Unit', ignoring. foobar.service: Failed to create foobar.service/start: Unit sysinit.target not found.
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/systemd-analyze2
-rw-r--r--shell-completion/zsh/_systemd-analyze1
2 files changed, 2 insertions, 1 deletions
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
index 36fcf432ff..e0a9ef5d15 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/shell-completion/bash/systemd-analyze
@@ -125,7 +125,7 @@ _systemd_analyze() {
elif __contains_word "$verb" ${VERBS[VERIFY]}; then
if [[ $cur = -* ]]; then
- comps='--help --version --system --user --global --man=no --generators=yes'
+ comps='--help --version --system --user --global --man=no --generators=yes --root'
else
comps=$( compgen -A file -- "$cur" )
compopt -o filenames
diff --git a/shell-completion/zsh/_systemd-analyze b/shell-completion/zsh/_systemd-analyze
index ce8e6162e8..921b6cb27d 100644
--- a/shell-completion/zsh/_systemd-analyze
+++ b/shell-completion/zsh/_systemd-analyze
@@ -87,6 +87,7 @@ _arguments \
'--system[Operate on system systemd instance]' \
'--user[Operate on user systemd instance]' \
'--global[Show global user instance config]' \
+ '--root=[Add support for root argument]:PATH' \
'--no-pager[Do not pipe output into a pager]' \
'--man=[Do (not) check for existence of man pages]:boolean:(1 0)' \
'--order[When generating graph for dot, show only order]' \