diff options
author | David Zeuthen <davidz@redhat.com> | 2007-12-05 23:58:44 -0500 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2007-12-05 23:58:44 -0500 |
commit | dd2c0163b5a1b429a4957b41d2c4cdc2db5cafe6 (patch) | |
tree | 74b0fa866ac53cc6ea28a287a26f77d4768895e8 | |
parent | b1dd4f0f10b81f73a5c16eb0dfd60069ad04c469 (diff) |
update completion + man page since polkit-auth(1) takes >1 --constraint args
-rw-r--r-- | doc/man/polkit-auth.xml | 26 | ||||
-rw-r--r-- | tools/polkit-bash-completion.sh | 16 |
2 files changed, 25 insertions, 17 deletions
diff --git a/doc/man/polkit-auth.xml b/doc/man/polkit-auth.xml index f10b8e5..cbcf092 100644 --- a/doc/man/polkit-auth.xml +++ b/doc/man/polkit-auth.xml @@ -23,8 +23,8 @@ <arg><option>--show-obtainable</option></arg> <arg><option><arg><option>--user <replaceable>user</replaceable></option></arg> --explicit</option></arg> <arg><option><arg><option>--user <replaceable>user</replaceable></option></arg> --explicit-detail</option></arg> - <arg><option><arg><option>--user <replaceable>user</replaceable></option></arg> --grant <replaceable>action</replaceable></option><arg><option>--constraint <replaceable>constraint</replaceable></option></arg></arg> - <arg><option><arg><option>--user <replaceable>user</replaceable></option></arg> --block <replaceable>action</replaceable></option><arg><option>--constraint <replaceable>constraint</replaceable></option></arg></arg> + <arg><option><arg><option>--user <replaceable>user</replaceable></option></arg> --grant <replaceable>action</replaceable></option><arg><option>--constraint <replaceable>constraint</replaceable></option></arg>*</arg> + <arg><option><arg><option>--user <replaceable>user</replaceable></option></arg> --block <replaceable>action</replaceable></option><arg><option>--constraint <replaceable>constraint</replaceable></option></arg>*</arg> <arg><option><arg><option>--user <replaceable>user</replaceable></option></arg> --revoke <replaceable>action</replaceable></option></arg> <arg><option>--version</option></arg> <arg><option>--help</option></arg> @@ -102,34 +102,34 @@ </varlistentry> <varlistentry> - <term><option><arg><option>--user <replaceable>user</replaceable></option></arg> --grant <replaceable>action</replaceable></option><arg><option>--constraint <replaceable>constraint</replaceable></option></arg></term> + <term><option><arg><option>--user <replaceable>user</replaceable></option></arg> --grant <replaceable>action</replaceable></option><arg><option>--constraint <replaceable>constraint</replaceable></option></arg>*</term> <listitem> <para> Grant an authorization for an action. This is different than <literal>--obtain</literal> insofar that the <literal>defaults</literal> stanza of the .policy file - is not consulted. Optionally, a constraint on the granted - authorization can be specified; allowed values + is not consulted. Optionally, one or more constraints on + the granted authorization can be specified; allowed values are: <literal>local</literal>, - <literal>active</literal>, <literal>local+active</literal>. - The authorization needed to grant authorizations is + <literal>active</literal>. The authorization needed to + grant authorizations is <literal>org.freedesktop.policykit.grant</literal>. </para> </listitem> </varlistentry> <varlistentry> - <term><option><arg><option>--user <replaceable>user</replaceable></option></arg> --block <replaceable>action</replaceable></option><arg><option>--constraint <replaceable>constraint</replaceable></option></arg></term> + <term><option><arg><option>--user <replaceable>user</replaceable></option></arg> --block <replaceable>action</replaceable></option><arg><option>--constraint <replaceable>constraint</replaceable></option></arg>*</term> <listitem> <para> Grant an negative authorization for an action. Negative authorizations are normally used to block users that would normally be authorized due to implicit - authorizations. Optionally, a constraint on the granted - negative authorization can be specified; allowed values - are: <literal>local</literal>, - <literal>active</literal>, <literal>local+active</literal>. - The authorization needed to grant negative authorizations is + authorizations. Optionally, one or more constraints on the + granted negative authorization can be specified; allowed + values are: <literal>local</literal>, + <literal>active</literal>. The authorization needed to + grant negative authorizations is <literal>org.freedesktop.policykit.grant</literal> if the "beneficiary" is another user. </para> diff --git a/tools/polkit-bash-completion.sh b/tools/polkit-bash-completion.sh index 8d1d2a4..3a492e6 100644 --- a/tools/polkit-bash-completion.sh +++ b/tools/polkit-bash-completion.sh @@ -58,7 +58,7 @@ __polkit_auth() { COMPREPLY=($(compgen -W "$(polkit-action)" -- $cur)) ;; --constraint) - COMPREPLY=($(IFS=: compgen -S' ' -W "none:local:active:local+active" -- $cur)) + COMPREPLY=($(IFS=: compgen -S' ' -W "local:active" -- $cur)) ;; esac ;; @@ -68,11 +68,19 @@ __polkit_auth() { COMPREPLY=($(IFS=: compgen -S' ' -W "--constraint" -- $cur)) ;; esac + case "${COMP_WORDS[1]}" in + --grant|--block) + COMPREPLY=($(IFS=: compgen -S' ' -W "--constraint" -- $cur)) + ;; + esac ;; - 6) - case "${COMP_WORDS[5]}" in + *) + case "${COMP_WORDS[$(($COMP_CWORD - 1))]}" in --constraint) - COMPREPLY=($(IFS=: compgen -S' ' -W "none:local:active:local+active" -- $cur)) + COMPREPLY=($(IFS=: compgen -S' ' -W "local:active" -- $cur)) + ;; + *) + COMPREPLY=($(IFS=: compgen -S' ' -W "--constraint" -- $cur)) ;; esac ;; |