support for multiple users
This commit is contained in:
parent
a6aacee41b
commit
a349b1c3cb
@ -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.')
|
||||
|
Loading…
Reference in New Issue
Block a user