PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Wed Dec 5 21:01:56 PST 2007


 doc/man/polkit-auth.xml         |   26 +++++++++++++-------------
 tools/polkit-bash-completion.sh |   16 ++++++++++++----
 2 files changed, 25 insertions(+), 17 deletions(-)

New commits:
commit dd2c0163b5a1b429a4957b41d2c4cdc2db5cafe6
Author: David Zeuthen <davidz at redhat.com>
Date:   Wed Dec 5 23:58:44 2007 -0500

    update completion + man page since polkit-auth(1) takes >1 --constraint args

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
             ;;


More information about the hal-commit mailing list