2015-03-01 14:49:19 +01:00
|
|
|
---
|
|
|
|
shell-completion/bash/coredumpctl | 6 +++++-
|
|
|
|
shell-completion/bash/hostnamectl | 6 +++++-
|
|
|
|
shell-completion/bash/journalctl | 6 +++++-
|
|
|
|
shell-completion/bash/kernel-install | 13 ++++++++++++-
|
|
|
|
shell-completion/bash/localectl | 6 +++++-
|
|
|
|
shell-completion/bash/loginctl | 6 +++++-
|
|
|
|
shell-completion/bash/systemctl.in | 6 +++++-
|
|
|
|
shell-completion/bash/systemd-analyze | 6 +++++-
|
|
|
|
shell-completion/bash/systemd-run | 14 +++++++++++++-
|
|
|
|
shell-completion/bash/timedatectl | 6 +++++-
|
|
|
|
shell-completion/bash/udevadm | 6 +++++-
|
|
|
|
11 files changed, 70 insertions(+), 11 deletions(-)
|
|
|
|
|
|
|
|
Index: systemd/shell-completion/bash/coredumpctl
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/coredumpctl
|
|
|
|
+++ systemd/shell-completion/bash/coredumpctl
|
|
|
|
@@ -44,6 +44,10 @@ _coredumpctl() {
|
|
|
|
[DUMP]='dump gdb'
|
|
|
|
)
|
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
if __contains_word "$prev" '--output -o'; then
|
|
|
|
comps=$( compgen -A file -- "$cur" )
|
|
|
|
compopt -o filenames
|
|
|
|
@@ -82,4 +86,4 @@ _coredumpctl() {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _coredumpctl coredumpctl
|
|
|
|
+complete -o default -o bashdefault -F _coredumpctl coredumpctl
|
|
|
|
Index: systemd/shell-completion/bash/hostnamectl
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/hostnamectl
|
|
|
|
+++ systemd/shell-completion/bash/hostnamectl
|
2014-01-31 13:36:06 +01:00
|
|
|
@@ -30,6 +30,10 @@ _hostnamectl() {
|
|
|
|
local OPTS='-h --help --version --transient --static --pretty
|
2015-03-01 14:49:19 +01:00
|
|
|
--no-ask-password -H --host --machine'
|
2014-01-31 13:36:06 +01:00
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
if [[ $cur = -* ]]; then
|
|
|
|
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
|
|
|
return 0
|
2015-03-01 14:49:19 +01:00
|
|
|
@@ -61,4 +65,4 @@ _hostnamectl() {
|
2014-01-31 13:36:06 +01:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _hostnamectl hostnamectl
|
|
|
|
+complete -o default -o bashdefault -F _hostnamectl hostnamectl
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/journalctl
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/journalctl
|
|
|
|
+++ systemd/shell-completion/bash/journalctl
|
|
|
|
@@ -55,6 +55,10 @@ _journalctl() {
|
|
|
|
--root --machine'
|
2014-01-31 13:36:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
|
|
|
|
case $prev in
|
|
|
|
--boot|--this-boot|-b)
|
2015-03-01 14:49:19 +01:00
|
|
|
@@ -120,4 +124,4 @@ _journalctl() {
|
2014-01-31 13:36:06 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _journalctl journalctl
|
|
|
|
+complete -o default -o bashdefault -F _journalctl journalctl
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/kernel-install
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/kernel-install
|
|
|
|
+++ systemd/shell-completion/bash/kernel-install
|
2014-01-31 13:36:06 +01:00
|
|
|
@@ -18,11 +18,22 @@
|
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
+__contains_word () {
|
|
|
|
+ local w word=$1; shift
|
|
|
|
+ for w in "$@"; do
|
|
|
|
+ [[ $w = "$word" ]] && return
|
|
|
|
+ done
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
_kernel_install() {
|
|
|
|
local comps
|
|
|
|
local MACHINE_ID
|
|
|
|
local cur=${COMP_WORDS[COMP_CWORD]}
|
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
case $COMP_CWORD in
|
|
|
|
1)
|
|
|
|
comps="add remove"
|
|
|
|
@@ -47,4 +58,4 @@ _kernel_install() {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _kernel_install kernel-install
|
|
|
|
+complete -o default -o bashdefault -F _kernel_install kernel-install
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/localectl
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/localectl
|
|
|
|
+++ systemd/shell-completion/bash/localectl
|
|
|
|
@@ -36,6 +36,10 @@ _localectl() {
|
2014-01-31 13:36:06 +01:00
|
|
|
local OPTS='-h --help --version --no-convert --no-pager --no-ask-password
|
2015-03-01 14:49:19 +01:00
|
|
|
-H --host --machine'
|
2014-01-31 13:36:06 +01:00
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
if __contains_word "$prev" $OPTS; then
|
|
|
|
case $prev in
|
|
|
|
--host|-H)
|
2015-03-01 14:49:19 +01:00
|
|
|
@@ -89,4 +93,4 @@ _localectl() {
|
2014-01-31 13:36:06 +01:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _localectl localectl
|
|
|
|
+complete -o default -o bashdefault -F _localectl localectl
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/loginctl
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/loginctl
|
|
|
|
+++ systemd/shell-completion/bash/loginctl
|
|
|
|
@@ -38,6 +38,10 @@ _loginctl () {
|
|
|
|
[ARG]='--host -H --kill-who --property -p --signal -s --machine'
|
|
|
|
)
|
2014-01-31 13:36:06 +01:00
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
if __contains_word "$prev" ${OPTS[ARG]}; then
|
|
|
|
case $prev in
|
|
|
|
--signal|-s)
|
2015-03-01 14:49:19 +01:00
|
|
|
@@ -107,4 +111,4 @@ _loginctl () {
|
2014-01-31 13:36:06 +01:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _loginctl loginctl
|
|
|
|
+complete -o default -o bashdefault -F _loginctl loginctl
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/systemctl.in
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/systemctl.in
|
|
|
|
+++ systemd/shell-completion/bash/systemctl.in
|
|
|
|
@@ -96,6 +96,10 @@ _systemctl () {
|
2014-04-03 16:38:38 +02:00
|
|
|
[ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --root'
|
2014-01-31 13:36:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
if __contains_word "--user" ${COMP_WORDS[*]}; then
|
|
|
|
mode=--user
|
|
|
|
else
|
2015-03-01 14:49:19 +01:00
|
|
|
@@ -264,4 +268,4 @@ _systemctl () {
|
2014-01-31 13:36:06 +01:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _systemctl systemctl
|
|
|
|
+complete -o default -o bashdefault -F _systemctl systemctl
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/systemd-analyze
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/systemd-analyze
|
|
|
|
+++ systemd/shell-completion/bash/systemd-analyze
|
|
|
|
@@ -47,6 +47,10 @@ _systemd_analyze() {
|
|
|
|
[VERIFY]='verify'
|
2014-01-31 13:36:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
_init_completion || return
|
|
|
|
|
2014-03-11 09:24:11 +01:00
|
|
|
for ((i=0; i < COMP_CWORD; i++)); do
|
2015-03-01 14:49:19 +01:00
|
|
|
@@ -114,4 +118,4 @@ _systemd_analyze() {
|
2014-01-31 13:36:06 +01:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _systemd_analyze systemd-analyze
|
|
|
|
+complete -o default -o bashdefault -F _systemd_analyze systemd-analyze
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/systemd-run
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/systemd-run
|
|
|
|
+++ systemd/shell-completion/bash/systemd-run
|
2014-01-31 13:36:06 +01:00
|
|
|
@@ -17,6 +17,13 @@
|
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
+__contains_word () {
|
|
|
|
+ local w word=$1; shift
|
|
|
|
+ for w in "$@"; do
|
|
|
|
+ [[ $w = "$word" ]] && return
|
|
|
|
+ done
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
__systemctl() {
|
|
|
|
local mode=$1; shift 1
|
|
|
|
systemctl $mode --full --no-legend "$@"
|
2015-03-01 14:49:19 +01:00
|
|
|
@@ -38,6 +45,11 @@ _systemd_run() {
|
2014-01-31 13:36:06 +01:00
|
|
|
|
|
|
|
local mode=--system
|
|
|
|
local i
|
|
|
|
+
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
for (( i=1; i <= COMP_CWORD; i++ )); do
|
|
|
|
if [[ ${COMP_WORDS[i]} != -* ]]; then
|
|
|
|
local root_command=${COMP_WORDS[i]}
|
2015-03-01 14:49:19 +01:00
|
|
|
@@ -98,4 +110,4 @@ _systemd_run() {
|
2014-01-31 13:36:06 +01:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _systemd_run systemd-run
|
|
|
|
+complete -o default -o bashdefault -F _systemd_run systemd-run
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/timedatectl
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/timedatectl
|
|
|
|
+++ systemd/shell-completion/bash/timedatectl
|
2014-01-31 13:36:06 +01:00
|
|
|
@@ -30,6 +30,10 @@ _timedatectl() {
|
|
|
|
local OPTS='-h --help --version --adjust-system-clock --no-pager
|
2015-03-01 14:49:19 +01:00
|
|
|
--no-ask-password -H --host --machine'
|
2014-01-31 13:36:06 +01:00
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
if __contains_word "$prev" $OPTS; then
|
|
|
|
case $prev in
|
|
|
|
--host|-H)
|
|
|
|
@@ -73,4 +77,4 @@ _timedatectl() {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _timedatectl timedatectl
|
|
|
|
+complete -o default -o bashdefault -F _timedatectl timedatectl
|
2015-03-01 14:49:19 +01:00
|
|
|
Index: systemd/shell-completion/bash/udevadm
|
|
|
|
===================================================================
|
|
|
|
--- systemd.orig/shell-completion/bash/udevadm
|
|
|
|
+++ systemd/shell-completion/bash/udevadm
|
2014-01-31 13:36:06 +01:00
|
|
|
@@ -36,6 +36,10 @@ _udevadm() {
|
|
|
|
|
|
|
|
local verbs=(info trigger settle control monitor hwdb test-builtin test)
|
|
|
|
|
|
|
|
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
2014-03-11 09:24:11 +01:00
|
|
|
for ((i=0; i < COMP_CWORD; i++)); do
|
2014-01-31 13:36:06 +01:00
|
|
|
if __contains_word "${COMP_WORDS[i]}" "${verbs[@]}" &&
|
|
|
|
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
|
|
|
@@ -94,4 +98,4 @@ _udevadm() {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
-complete -F _udevadm udevadm
|
|
|
|
+complete -o default -o bashdefault -F _udevadm udevadm
|