support for multiple users

This commit is contained in:
blacktwin 2018-01-03 10:57:00 -05:00 committed by GitHub
parent a6aacee41b
commit a349b1c3cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.')