From 2149b00fdb53ade99a5ec4f54004a677f08fe6c1 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 26 Sep 1999 14:26:08 +0000 Subject: Initial revision --- Completion/User/_my_accounts | 14 ++++++++++++++ Completion/User/_other_accounts | 14 ++++++++++++++ Completion/User/_users_on | 11 +++++++++++ 3 files changed, 39 insertions(+) create mode 100644 Completion/User/_my_accounts create mode 100644 Completion/User/_other_accounts create mode 100644 Completion/User/_users_on (limited to 'Completion') diff --git a/Completion/User/_my_accounts b/Completion/User/_my_accounts new file mode 100644 index 000000000..91ab88cc1 --- /dev/null +++ b/Completion/User/_my_accounts @@ -0,0 +1,14 @@ +#autoload + +local expl nm="$compstate[nmatches]" +local accounts_users_hosts + +local varname="$words[1]_accounts" + +if [[ ${(P)+varname} -eq 1 ]]; then + accounts_users_hosts=( ${(P)varname} ) +else + accounts_users_hosts=( $my_accounts ) +fi + +_user@host diff --git a/Completion/User/_other_accounts b/Completion/User/_other_accounts new file mode 100644 index 000000000..b73515fcd --- /dev/null +++ b/Completion/User/_other_accounts @@ -0,0 +1,14 @@ +#compdef ytalk finger + +local expl nm="$compstate[nmatches]" +local accounts_users_hosts + +local varname="$words[1]_accounts" + +if [[ ${(P)+varname} -eq 1 ]]; then + accounts_users_hosts=( ${(P)varname} ) +else + accounts_users_hosts=( $other_accounts ) +fi + +_user@host diff --git a/Completion/User/_users_on b/Completion/User/_users_on new file mode 100644 index 000000000..920688089 --- /dev/null +++ b/Completion/User/_users_on @@ -0,0 +1,11 @@ +#autoload write + +local expl + +if which users >/dev/null; then + _description expl users logged on + compadd "$@" "$expl[@]" - $(users) && return 0 +else + # Other methods of finding out users logged on should be added here + return 1 +fi -- cgit 1.4.1