allow the use of nicos_gui/nicos_cli
instead of 'nicos gui' / 'nicos cli' beacuse of possible conflict with existing nicos command
This commit is contained in:
@@ -10,18 +10,18 @@ usage = """
|
||||
Usage:
|
||||
|
||||
nicos-gui start nicos gui
|
||||
nicos gui start nicos gui and connect without asking for password
|
||||
nicos_gui start nicos gui and connect without asking for password
|
||||
nicos-client start nicos command line client
|
||||
nicos cli start nicos command line client and connect without asking for password
|
||||
nicos_cli start nicos command line client and connect without asking for password
|
||||
"""
|
||||
|
||||
# yr = time.strftime('%y')
|
||||
connect = f'user:sinq@localhost'
|
||||
|
||||
if sys.argv[-1] == 'cli':
|
||||
if sys.argv[-1] == 'cli' or sys.argv[0].endswith('cli'):
|
||||
from nicos.clients.cli import main
|
||||
sys.exit(main([connect]))
|
||||
elif sys.argv[-1] == 'gui':
|
||||
elif sys.argv[-1] == 'gui' or sys.argv[0].endswith('gui'):
|
||||
from nicos.clients.gui.main import main
|
||||
instrument = gethostname().split('.')[0]
|
||||
guiconfig = f'{nicosroot}/nicos_sinq/{instrument}/guiconfig.py'
|
||||
|
||||
Reference in New Issue
Block a user