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,
|
parser.add_argument('-s', '--share', nargs='?', type=str, required=True,
|
||||||
choices=['share', 'share_all', 'unshare'], metavar='',
|
choices=['share', 'share_all', 'unshare'], metavar='',
|
||||||
help='To share or to unshare.: \n (choices: %(choices)s)')
|
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'
|
help='Space separated list of case sensitive names to process. Allowed names are: \n'
|
||||||
'(choices: %(choices)s)')
|
'(choices: %(choices)s)')
|
||||||
parser.add_argument('-l', '--libraries', nargs='+', default='', choices=sections_lst, metavar='',
|
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)')
|
'(choices: %(choices)s \n(default: All Libraries)')
|
||||||
|
|
||||||
opts = parser.parse_args()
|
opts = parser.parse_args()
|
||||||
|
|
||||||
if opts.share == 'share':
|
for user in opts.user:
|
||||||
share(opts.user, opts.libraries)
|
if opts.share == 'share':
|
||||||
elif opts.share == 'unshare':
|
share(user, opts.libraries)
|
||||||
unshare(opts.user, sections_lst)
|
elif opts.share == 'share_all':
|
||||||
elif opts.share == 'share_all':
|
share(user, sections_lst)
|
||||||
share(opts.user, sections_lst)
|
elif opts.share == 'unshare':
|
||||||
else:
|
unshare(user, sections_lst)
|
||||||
print('I don\'t know what else you want.')
|
else:
|
||||||
|
print('I don\'t know what else you want.')
|
||||||
|
Loading…
Reference in New Issue
Block a user