systemctl: add --timestamp to change timestamp print format
Timestamps for unit start/stop are recorded with microsecond granularity, but status and show truncate to second granularity by default. Add a --timestamp=pretty|us|utc option to allow including the microseconds or to use the UTC TZ to all timestamps printed by systemctl.
This commit is contained in:
@@ -127,7 +127,7 @@ _systemctl () {
|
||||
--quiet -q --system --user --version --runtime --recursive -r --firmware-setup
|
||||
--show-types -i --ignore-inhibitors --plain --failed --value --fail --dry-run --wait'
|
||||
[ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --job-mode --root
|
||||
--preset-mode -n --lines -o --output -M --machine --message'
|
||||
--preset-mode -n --lines -o --output -M --machine --message --timestamp'
|
||||
)
|
||||
|
||||
if __contains_word "--user" ${COMP_WORDS[*]}; then
|
||||
@@ -176,6 +176,9 @@ _systemctl () {
|
||||
--machine|-M)
|
||||
comps=$( __get_machines )
|
||||
;;
|
||||
--timestamp)
|
||||
comps='pretty us µs utc us+utc µs+utc'
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user