mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 21:58:12 +08:00
GUI UI Elements (#816)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import shlex
|
||||
|
||||
import click
|
||||
|
||||
from server.cli.launch import common_args
|
||||
from server.utils.errors import OptionsError
|
||||
|
||||
|
||||
@click.command()
|
||||
@common_args
|
||||
def cli(**kwargs):
|
||||
pass
|
||||
|
||||
|
||||
def parse_opt_string(opts):
|
||||
context = click.Context(cli)
|
||||
parser = click.OptionParser(context)
|
||||
for command in context.command.params:
|
||||
command.add_to_parser(parser, context)
|
||||
|
||||
try:
|
||||
opts, args, param_order = parser.parse_args(shlex.split(opts))
|
||||
for param in cli.params:
|
||||
value, args = param.handle_parse_result(context, opts, args)
|
||||
except click.ClickException as ce:
|
||||
raise OptionsError(ce.message) from ce
|
||||
return dict(context.params)
|
||||
Reference in New Issue
Block a user