summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2022-09-13 16:13:16 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-10-13 07:47:42 +0900
commitd1d8786c5b4493cc0f9836b1976f2cd41bfb461c (patch)
treedf19253c23a7db5a219e03d6abf5cc0501632fbb /shell-completion
parent17f6406bf2f3e3bdaf51fd567871876da237ce20 (diff)
downloadsystemd-d1d8786c5b4493cc0f9836b1976f2cd41bfb461c.tar.gz
analyze: extend the dump command to accept patterns
The new function DumpPatterns() can be used to limit (drastically) the size of the data returned by PID1. Hence the optimization of serializing data into a file descriptor should be less relevant than having the possibility to limit the data when communicating with the service manager remotely. NB: when passing patterns, the dump command omits the version of the manager as well as the features and the timestamps.
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/systemd-analyze10
1 files changed, 9 insertions, 1 deletions
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
index 9fe984d87c..fe2c1d122c 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/shell-completion/bash/systemd-analyze
@@ -60,9 +60,10 @@ _systemd_analyze() {
)
local -A VERBS=(
- [STANDALONE]='time blame plot dump unit-paths exit-status calendar timestamp timespan'
+ [STANDALONE]='time blame plot unit-paths exit-status calendar timestamp timespan'
[CRITICAL_CHAIN]='critical-chain'
[DOT]='dot'
+ [DUMP]='dump'
[VERIFY]='verify'
[SECCOMP_FILTER]='syscall-filter'
[CAT_CONFIG]='cat-config'
@@ -125,6 +126,13 @@ _systemd_analyze() {
comps='--help --version --system --user --global --from-pattern --to-pattern --order --require'
fi
+ elif __contains_word "$verb" ${VERBS[DUMP]}; then
+ if [[ $cur = -* ]]; then
+ comps='--help --version --system --user --no-pager'
+ else
+ comps=$( __get_units_all )
+ fi
+
elif __contains_word "$verb" ${VERBS[SECCOMP_FILTER]}; then
if [[ $cur = -* ]]; then
comps='--help --version --no-pager'