Commit dd2c0163 authored by David Zeuthen's avatar David Zeuthen
Browse files

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

parent b1dd4f0f
......@@ -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>
......
......@@ -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
;;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment