CLI improvements (#221)

* CLI improvements

* Circumvent apparent bug with subparsers.required
This commit is contained in:
Philipp A
2018-10-04 16:41:14 -07:00
committed by Charlotte Weaver
parent 187bbfdcf7
commit 8674ad1f7f
2 changed files with 17 additions and 1 deletions
+5 -1
View File
@@ -73,12 +73,16 @@ def main():
"--bind-all",
help="Bind to all interfaces (this makes the server accessible beyond this computer)",
action="store_true")
subparsers = parser.add_subparsers(dest="cellxgene_command")
subparsers = parser.add_subparsers(dest="engine")
subparsers.required = True
try:
from .scanpy_engine.scanpy_engine import ScanpyEngine
except ImportError:
warnings.simplefilter('default', ImportWarning) # Enable ImportWarning
warnings.warn("Scanpy engine not available", ImportWarning)
else:
ScanpyEngine.add_to_parser(subparsers, run_scanpy)
if len(subparsers.choices) == 0:
raise ImportError('Could not import any engines, see warnings above')
args = parser.parse_args()
args.func(args)