improve missing arg handling

- better error messages
- missing instrument is only allowed with 'list'
- missing argument to be replaced with ? in error message
- sea cli may now be given with 'graph' or 'sea' for service
This commit is contained in:
l_samenv
2025-01-21 10:49:54 +01:00
parent fda6e37238
commit 556a7eff9d
3 changed files with 23 additions and 15 deletions

View File

@ -68,7 +68,7 @@ class SeaManager(ServiceManager):
%(legend)s
"""
def do_cli(self, ins):
def do_cli(self, ins, service=None):
if self.wildcard(ins):
raise UsageError('wildcards not allowed in sea cli')
try:
@ -78,7 +78,8 @@ class SeaManager(ServiceManager):
print(str(e))
except KeyError: # running on an other machine?
self.do_help()
run_command('six -sea %s' % ins, wait=True)
service = service or 'sea'
run_command(f'six -{service} {ins}', wait=True)
def do_gui(self, ins='', *args):
if ins and self.wildcard(ins):
@ -196,6 +197,8 @@ class SeaManager(ServiceManager):
argdict['ins'] = arg
else:
raise UsageError('unknown argument: %s' % arg)
else:
print('env variable "InstrumentHostList" is not defined')
result = [argdict.pop('ins', '')]
service = argdict.pop('service', '')
if service: