diff options
Diffstat (limited to 'sys-auth/policykit/files/policykit-0.92-zsh-completions.patch')
-rw-r--r-- | sys-auth/policykit/files/policykit-0.92-zsh-completions.patch | 159 |
1 files changed, 0 insertions, 159 deletions
diff --git a/sys-auth/policykit/files/policykit-0.92-zsh-completions.patch b/sys-auth/policykit/files/policykit-0.92-zsh-completions.patch deleted file mode 100644 index 6c6e24143b32..000000000000 --- a/sys-auth/policykit/files/policykit-0.92-zsh-completions.patch +++ /dev/null @@ -1,159 +0,0 @@ -Author: Saleem Abdulrasool <compnerd@compnerd.org> -Date: Mon Nov 19 15:35:03 2007 -0800 - - add zsh completion and optionalize bash and zsh completion - - Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> - - - tools/_polkit | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ - tools/_polkit_action | 24 ++++++++++++++++++++++ - tools/_polkit_auth | 50 ++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 128 insertions(+), 0 deletions(-) - -diff --git a/tools/_polkit b/tools/_polkit -new file mode 100644 -index 0000000..bc7bdac ---- /dev/null -+++ tools/_polkit -@@ -0,0 +1,54 @@ -+#autoload -+ -+# vim: set et sw=3 sts=3 ts=3 ft=zsh: -+# ZSH Completion for polkit-auth -+# Written by Saleem Abdulrasool <compnerd@compnerd.org> -+# Usage: _polkit actions|constraints|authorization|overriden-actions|obtainable-actions|authorized-actions -+ -+_polkit_actions() { -+ local actions -+ actions=( $(polkit-action) ) -+ compadd "$@" -k actions -+} -+ -+_polkit_constraints() { -+ local constraints -+ constraints=( local active local+active ) -+ compadd "$@" -k constraints -+} -+ -+_polkit_authorization() { -+ local authorization -+ authorization=( no auth_admin_one_shot auth_admin auth_admin_keep_session auth_admin_keep_always auth_self_one_shot auth_self auth_self_keep_session auth_self_keep_always yes ) -+ compadd "$@" -k authorization -+} -+ -+_polkit_overriden_actions() { -+ local overrides -+ overrides=( $(polkit-action --show-overrides) ) -+ compadd "$@" -k overrides -+} -+ -+_polkit_obtainable_actions() { -+ local actions -+ actions=( $(polkit-auth --show-obtainable) ) -+ compadd "$@" -k actions -+} -+ -+_polkit_authorized_actions() { -+ local actions -+ actions=( $(polkit-auth --explicit) ) -+ compadd "$@" -k actions -+} -+ -+_polkit() { -+ local command="$argv[$#]" -+ -+ [[ "$command" == (actions|constraints|authorization|overriden-actions|obtainable-actions|authorized-actions) ]] || { -+ _message "unknown command: $command" -+ } -+ -+ _polkit_${command/-/_} -+} -+ -+_polkit "$@" -diff --git a/tools/_polkit_action b/tools/_polkit_action -new file mode 100644 -index 0000000..7ec7365 ---- /dev/null -+++ tools/_polkit_action -@@ -0,0 +1,24 @@ -+#compdef polkit-action -+ -+# vim: set et sw=3 sts=3 ts=3 ft=zsh: -+# ZSH Completion for polkit-action -+# Written by Saleem Abdulrasool <compnerd@compnerd.org> -+ -+_polkit_action() { -+ local arguments -+ -+ arguments=( -+ "(-)--action[Show detailed information about a specific action]:action:_polkit actions" -+ "(-)--reset-defaults[Reset the defaults for the specified action]:Overridden Action:_polkit overriden-actions" -+ "(-)--show-overrides[List actions where the defaults are overridden]" -+ "(-)--set-defaults-any[Override the any stanza for an action]:Action:_polkit _actions:Authorization:_polkit authorization" -+ "(-)--set-defaults-inactive[Override the inactive stanza for an action]:Action:polkit _actions:Authorization:_polkit authorization" -+ "(-)--set-defaults-active[Override the active stanza for an action]:Action:polkit _actions:Authorization:_polkit authorization" -+ "(-)--version[Display program version]" -+ "(-)--help[Display program help]" -+ ) -+ -+ _arguments $arguments -+} -+ -+_polkit_action "$@" -diff --git a/tools/_polkit_auth b/tools/_polkit_auth -new file mode 100644 -index 0000000..e70f1a0 ---- /dev/null -+++ tools/_polkit_auth -@@ -0,0 +1,50 @@ -+#compdef polkit-auth -+ -+# vim: set et sw=3 sts=3 ts=3 ft=zsh: -+# ZSH Completion for polkit-auth -+# Written by Saleem Abdulrasool <compnerd@compnerd.org> -+ -+_polkit_auth() { -+ local arguments action_arguments user_arguments grant_arguments -+ local commands actions grant=0 -+ -+ commands=( --show-obtainable --version --help ) -+ actions=( --obtain --explicit --explicit-detail --grant --revoke ) -+ -+ for (( i = 0 ; i < ${#words[@]} ; i++ )) ; do -+ if [[ "${words[$i]##--#}" == "grant" ]] ; then -+ grant=1 -+ break -+ fi -+ done -+ -+ arguments=( -+ '(-)--show-obtainable[Show all actions that can be obtained via authentication]' -+ '(-)--version[Show version and exit]' -+ '(-)--help[Show help information]' -+ ) -+ -+ action_arguments=( -+ "($commands $actions)--obtain[Attempt to obtain authorization to do an action]:Obtainable Actions:_polkit obtainable-actions" -+ "($commands $actions)--explicit[Show explicit authorizations]" -+ "($commands $actions)--explicit-detail[Show detailed information about explicit authorizations]" -+ "($commands $actions)--grant[Grant an authorization for an action]:Obtainable Actions:_polkit actions" -+ "($commands $actions)--revoke[Revoke all authorization for an action]:Authorized Actions:_polkit authorized-actions" -+ ) -+ -+ user_arguments=( -+ "($commands)--user[The user the authorization applies to]:User:_users" -+ ) -+ -+ grant_arguments=( -+ "($commands)--constraint[Optional constraints on the granted authorization]:Constraint:_polkit constraints" -+ ) -+ -+ if [[ grant -eq 1 ]] ; then -+ _arguments $arguments $user_arguments $action_arguments $grant_arguments -+ else -+ _arguments $arguments $user_arguments $action_arguments -+ fi -+} -+ -+_polkit_auth "$@" |