fix some pr feedbacks
This commit is contained in:
parent
8c9ddd2d27
commit
8f5a2803a6
|
@ -24,7 +24,7 @@ def get():
|
|||
|
||||
|
||||
@positions.command(short_help='Update positions')
|
||||
def update(**kwargs):
|
||||
def set(**kwargs):
|
||||
click.echo('The positions will be updated:')
|
||||
print_colon_kv(kwargs.items())
|
||||
click.confirm('Do you want to continue?', abort=True)
|
||||
|
@ -37,7 +37,7 @@ def update(**kwargs):
|
|||
@component.provideHandler
|
||||
@component.adapter(IRegistered)
|
||||
def _handler(event):
|
||||
global update
|
||||
global set
|
||||
|
||||
if not (IUtilityRegistration.providedBy(event.object) and IConfig.providedBy(event.object.component)):
|
||||
return
|
||||
|
@ -47,4 +47,5 @@ def _handler(event):
|
|||
required = cfg.get('positions_required')
|
||||
|
||||
for pos in avail:
|
||||
update = click.option(f'--{pos}', metavar='USER', required=(pos in required))(update)
|
||||
r = pos in required
|
||||
set = click.option(f'--{pos}', metavar='USERNAME', required=r, prompt=r)(set)
|
||||
|
|
Loading…
Reference in New Issue