malcontent-client: Rename ‘check’ command to ‘check-app-filter’

Since it operates only on the app filter. This updates the documentation
too. No compatibility fallback is provided.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-01-16 11:00:52 +00:00
parent b3dbc07b92
commit 983e3bfa39
2 changed files with 22 additions and 21 deletions

View File

@ -12,7 +12,7 @@ malcontent\-client — Parental Controls Access Utility
.\"
\fBmalcontent\-client get\-app\-filter [\-q] [\-n] [\fPUSER\fB]
.PP
\fBmalcontent\-client check [\-q] [\-n] [\fPUSER\fB] \fPARG\fB
\fBmalcontent\-client check\-app\-filter [\-q] [\-n] [\fPUSER\fB] \fPARG\fB
.\"
.SH DESCRIPTION
.IX Header "DESCRIPTION"
@ -25,7 +25,7 @@ controls.
It communicates with accounts-service, which stores parental controls data.
.PP
Its first argument is a command to run. Currently, the only supported commands
are \fBget\-app\-filter\fP and \fBcheck\fP.
are \fBget\-app\-filter\fP and \fBcheck\-app\-filter\fP.
.\"
.SH \fBget\-app\-filter\fP OPTIONS
.IX Header "get\-app\-filter OPTIONS"
@ -43,8 +43,8 @@ Do not allow interactive authorization with polkit. If this is needed to
complete the operation, the operation will fail. (Default: Allow interactive
authorization.)
.\"
.SH \fBcheck\fP OPTIONS
.IX Header "check OPTIONS"
.SH \fBcheck\-app\-filter\fP OPTIONS
.IX Header "check\-app\-filter OPTIONS"
.\"
.IP "\fBUSER\fP"
Username or ID of the user to get the app filter for. If not specified, the
@ -85,8 +85,8 @@ encounters problems.
.IP "0" 4
.IX Item "0"
No problems occurred. The utility ran and successfully queried the app filter.
If running the \fBcheck\fP command, the given path, content type or flatpak ref
was allowed for the given user.
If running the \fBcheck\-app\-filter\fP command, the given path, content type or
flatpak ref was allowed for the given user.
.\"
.IP "1" 4
.IX Item "1"
@ -99,8 +99,8 @@ The current user was not authorized to query the app filter for the given user.
.\"
.IP "3" 4
.IX Item "3"
If running the \fBcheck\fP command, the given path, content type or flatpak ref
was \fInot\fP allowed for the given user.
If running the \fBcheck\-app\-filter\fP command, the given path, content type or
flatpak ref was \fInot\fP allowed for the given user.
.\"
.SH BUGS
.IX Header "BUGS"

View File

@ -213,7 +213,7 @@ def is_valid_content_type(arg):
parts[0] != '' and parts[1] != '')
def command_check(user, arg, quiet=False, interactive=True):
def command_check_app_filter(user, arg, quiet=False, interactive=True):
"""Check the given path, content type or flatpak ref is runnable by the
given user, according to their app filter."""
user_id = __lookup_user_id_or_error(user)
@ -375,18 +375,19 @@ def main():
help='user ID or username to monitor the app '
'filter for (default: all users)')
# check command
parser_check = subparsers.add_parser('check', parents=[common_parser],
help='check whether a path, content '
'type or flatpak ref is '
'allowed by app filter')
parser_check.set_defaults(function=command_check)
parser_check.add_argument('user', default='', nargs='?',
help='user ID or username to get the app filter '
'for (default: current user)')
parser_check.add_argument('arg',
help='path to a program, content type or '
'flatpak ref to check')
# check-app-filter command
parser_check_app_filter = \
subparsers.add_parser('check-app-filter', parents=[common_parser],
help='check whether a path, content type or '
'flatpak ref is allowed by app filter')
parser_check_app_filter.set_defaults(function=command_check_app_filter)
parser_check_app_filter.add_argument('user', default='', nargs='?',
help='user ID or username to get the '
'app filter for (default: '
'current user)')
parser_check_app_filter.add_argument('arg',
help='path to a program, content '
'type or flatpak ref to check')
# oars-section command
parser_oars_section = subparsers.add_parser('oars-section',