mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 23:10:42 +01:00
python3: cli: add workaround for required subcommand
http://bugs.python.org/issue9253#msg186387 Fixes #239 Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
from multiprocessing import cpu_count
|
||||
|
||||
@@ -55,6 +56,11 @@ def parse_args(argv=None):
|
||||
dest='cmd',
|
||||
help='Use dvc CMD --help for command-specific help')
|
||||
|
||||
# NOTE: Workaround for bug in Python 3
|
||||
if sys.version_info[0] == 3:
|
||||
subparsers.required = True
|
||||
subparsers.dest = 'cmd'
|
||||
|
||||
# Init
|
||||
init_parser = subparsers.add_parser(
|
||||
'init',
|
||||
|
||||
Reference in New Issue
Block a user