chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shell-completion: work on session shell is --user is used
[elogind.git]
/
shell-completion
/
systemd-zsh-completion.zsh
diff --git
a/shell-completion/systemd-zsh-completion.zsh
b/shell-completion/systemd-zsh-completion.zsh
index 177a564d3837bb673bdf2308858af7c7f7b23760..46a6a1900c753a8dbacda11204412e5153d0ac64 100644
(file)
--- a/
shell-completion/systemd-zsh-completion.zsh
+++ b/
shell-completion/systemd-zsh-completion.zsh
@@
-70,6
+70,7
@@
_ctls()
{-c,--cursor=}'[Start showing entries from specified cursor]:cursors:_journal_fields __CURSORS' \
{-b,--this-boot}'[Show data only from current boot]' \
{-u,--unit=}'[Show data only from the specified unit]:units:_journal_fields _SYSTEMD_UNIT' \
{-c,--cursor=}'[Start showing entries from specified cursor]:cursors:_journal_fields __CURSORS' \
{-b,--this-boot}'[Show data only from current boot]' \
{-u,--unit=}'[Show data only from the specified unit]:units:_journal_fields _SYSTEMD_UNIT' \
+ '--user-unit[Show data only from the specified user session unit]:units:_journal_fields _SYSTEMD_USER_UNIT' \
{-p,--priority=}'[Show only messages within the specified priority range]:priority:_journal_fields PRIORITY' \
{-f,--follow}'[Follow journal]' \
{-n,--lines=}'[Number of journal entries to show]:integer' \
{-p,--priority=}'[Show only messages within the specified priority range]:priority:_journal_fields PRIORITY' \
{-f,--follow}'[Follow journal]' \
{-n,--lines=}'[Number of journal entries to show]:integer' \
@@
-93,6
+94,7
@@
_ctls()
'--verify[Verify journal file consistency]' \
'--list-catalog[List messages in catalog]' \
'--update-catalog[Update binary catalog database]' \
'--verify[Verify journal file consistency]' \
'--list-catalog[List messages in catalog]' \
'--update-catalog[Update binary catalog database]' \
+ '*::default: _journal_none'
;;
localectl)
_arguments \
;;
localectl)
_arguments \
@@
-271,7
+273,7
@@
_systemd-nspawn(){
}
_systemd_inhibit_command(){
}
_systemd_inhibit_command(){
- if (( CURRENT == 1 )); then
+ if (( CURRENT == 1 )); then
compset -q
_normal
else
compset -q
_normal
else
@@
-315,7
+317,7
@@
_outputmodes() {
_output_opts=(short short-monotonic verbose export json json-pretty json-see cat)
_describe -t output 'output mode' _output_opts || compadd "$@"
}
_output_opts=(short short-monotonic verbose export json json-pretty json-see cat)
_describe -t output 'output mode' _output_opts || compadd "$@"
}
-
+
(( $+functions[_systemctl_command] )) || _systemctl_command()
{
(( $+functions[_systemctl_command] )) || _systemctl_command()
{
@@
-402,7
+404,9
@@
_outputmodes() {
__systemctl()
{
__systemctl()
{
- systemctl --full --no-legend --no-pager "$@"
+ local -a _modes
+ _modes=("--user" "--system")
+ systemctl ${words:*_modes} --full --no-legend --no-pager "$@"
}
}
@@
-554,7
+558,7
@@
done
(( $+functions[_systemctl_delete] )) || _systemctl_delete()
{
compadd "$@" - $(__systemctl list-units --type snapshot --all \
(( $+functions[_systemctl_delete] )) || _systemctl_delete()
{
compadd "$@" - $(__systemctl list-units --type snapshot --all \
- | cut -d' ' -f1 2>/dev/null ) || _message "no sna
m
pshot found"
+ | cut -d' ' -f1 2>/dev/null ) || _message "no snapshot found"
}
# Completion functions for ENVS
}
# Completion functions for ENVS
@@
-607,6
+611,7
@@
_list_fields() {
_{P,U,G}ID _COMM _EXE _CMDLINE
_AUDIT_{SESSION,LOGINUID}
_SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID}
_{P,U,G}ID _COMM _EXE _CMDLINE
_AUDIT_{SESSION,LOGINUID}
_SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID}
+ _SYSTEMD_USER_UNIT
_SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP
_{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT
_KERNEL_{DEVICE,SUBSYSTEM}
_SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP
_{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT
_KERNEL_{DEVICE,SUBSYSTEM}
@@
-615,10
+620,19
@@
_list_fields() {
_describe 'possible fields' journal_fields
}
_describe 'possible fields' journal_fields
}
+_journal_none() {
+ local -a _commands _files
+ _commands=( ${(f)"$(_call_program commands "$service" -F _EXE 2>/dev/null)"} )
+ _alternative : \
+ 'files:/dev files:_files -W /dev -P /dev/' \
+ "commands:commands:($_commands[@])" \
+ 'fields:fields:_list_fields'
+}
+
_journal_fields() {
local -a _fields cmd
cmd=("journalctl" "-F ${@[-1]}" "2>/dev/null" )
_journal_fields() {
local -a _fields cmd
cmd=("journalctl" "-F ${@[-1]}" "2>/dev/null" )
- _fields=( ${(f)"$(_call_program fields $cmd[@])"} )
+ _fields=( ${(f)"$(_call_program fields $cmd[@])"} )
typeset -U _fields
_describe 'possible values' _fields
}
typeset -U _fields
_describe 'possible values' _fields
}
@@
-775,8
+789,8
@@
_localectl_set-x11-keymap() {
#_model=( ${(f)"$(echo $_file[2] | awk '/^ / {print $1}')"} )
#_variant=( ${(f)"$(echo $_file[3] | awk '/^ / {print $1}')"} )
#_options=( ${(f)"$(echo ${_file[4]//:/\\:} | awk '/^ / {print $1}')"} )
#_model=( ${(f)"$(echo $_file[2] | awk '/^ / {print $1}')"} )
#_variant=( ${(f)"$(echo $_file[3] | awk '/^ / {print $1}')"} )
#_options=( ${(f)"$(echo ${_file[4]//:/\\:} | awk '/^ / {print $1}')"} )
-
- case $CURRENT in
+
+ case $CURRENT in
2) _describe layouts _layout ;;
3) _describe models _model;;
4) _describe variants _variant;;
2) _describe layouts _layout ;;
3) _describe models _model;;
4) _describe variants _variant;;
@@
-943,7
+957,7
@@
_udevadm_control(){
'--timeout=[The maximum number of seconds to wait for a reply from systemd-udevd.]' \
'--help[Print help text.]'
}
'--timeout=[The maximum number of seconds to wait for a reply from systemd-udevd.]' \
'--help[Print help text.]'
}
-
+
_udevadm_monitor(){
_arguments \
'--kernel[Print the kernel uevents.]' \
_udevadm_monitor(){
_arguments \
'--kernel[Print the kernel uevents.]' \
@@
-966,7
+980,7
@@
_udevadm_test-builtin(){
if (( CURRENT == 2 )); then
_arguments \
'--help[Print help text]' \
if (( CURRENT == 2 )); then
_arguments \
'--help[Print help text]' \
- '*::builtins:(blkid btrfs
firmware
hwdb input_id kmod path_id usb_id uaccess)'
+ '*::builtins:(blkid btrfs hwdb input_id kmod path_id usb_id uaccess)'
elif (( CURRENT == 3 )); then
_arguments \
'--help[Print help text]' \
elif (( CURRENT == 3 )); then
_arguments \
'--help[Print help text]' \