diff --git a/utility/plex_api_share.py b/utility/plex_api_share.py index aaa3ed4..9554b84 100644 --- a/utility/plex_api_share.py +++ b/utility/plex_api_share.py @@ -58,7 +58,7 @@ if __name__ == "__main__": parser.add_argument('-s', '--share', nargs='?', type=str, required=True, choices=['share', 'share_all', 'unshare'], metavar='', help='To share or to unshare.: \n (choices: %(choices)s)') - parser.add_argument('-u', '--user', nargs='?', type=str, required=True, choices=user_lst, metavar='', + parser.add_argument('-u', '--user', nargs='+', type=str, required=True, choices=user_lst, metavar='', help='Space separated list of case sensitive names to process. Allowed names are: \n' '(choices: %(choices)s)') parser.add_argument('-l', '--libraries', nargs='+', default='', choices=sections_lst, metavar='', @@ -66,12 +66,13 @@ if __name__ == "__main__": '(choices: %(choices)s \n(default: All Libraries)') opts = parser.parse_args() - - if opts.share == 'share': - share(opts.user, opts.libraries) - elif opts.share == 'unshare': - unshare(opts.user, sections_lst) - elif opts.share == 'share_all': - share(opts.user, sections_lst) - else: - print('I don\'t know what else you want.') + + for user in opts.user: + if opts.share == 'share': + share(user, opts.libraries) + elif opts.share == 'share_all': + share(user, sections_lst) + elif opts.share == 'unshare': + unshare(user, sections_lst) + else: + print('I don\'t know what else you want.')