diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2021-03-03 10:17:11 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-03-03 11:17:05 +0100 |
commit | c80f27c98ca1748ca08cb00bd57eb4c3baba79a5 (patch) | |
tree | 31979199147dd935fc0f526f5820f9e95f95b0e2 /cli/objects/modes.py | |
parent | 1be7f3f8a85ee1f09fd681e774511674538067ef (diff) |
Make client and center params more specific
Non specific parameter names like '--center' or '--client' should not be
used to specify an ip or id, only a literal name.
Rename --client to --client-ip and --center to --center-id to leave
unspecific parameters free to later implement --center or --client using
names.
Diffstat (limited to 'cli/objects/modes.py')
-rw-r--r-- | cli/objects/modes.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/objects/modes.py b/cli/objects/modes.py index 53cd79a..c228eb0 100644 --- a/cli/objects/modes.py +++ b/cli/objects/modes.py @@ -19,19 +19,19 @@ class OgModes(): def set_modes(rest, args): parser = argparse.ArgumentParser() group = parser.add_argument_group('clients', 'Client selection args') - group.add_argument('--center', + group.add_argument('--center-id', type=int, action='append', default=[], required=False, - help='Clients from given center') + help='Clients from given center id') group.add_argument('--room-id', type=int, action='append', default=[], required=False, help='Clients from given room id') - group.add_argument('--client', + group.add_argument('--client-ip', action='append', default=[], required=False, @@ -66,13 +66,13 @@ class OgModes(): scopes = r.json() ips = set() - for center in parsed_args.center: + for center in parsed_args.center_id: center_scope = scope_lookup(center, 'center', scopes) ips.update(ips_in_scope(center_scope)) for room in parsed_args.room_id: room_scope = scope_lookup(room, 'room', scopes) ips.update(ips_in_scope(room_scope)) - for l in parsed_args.client: + for l in parsed_args.client_ip: ips.add(l) if not ips: |