pipeline: use Dvcfile by default

Fixes #970

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-08-19 21:01:47 +03:00
parent c378e4b3d2
commit 8a484df228
+11 -4
View File
@@ -762,14 +762,21 @@ def parse_args(argv=None):
help='Output DAG as ASCII.')
pipeline_show_parser.add_argument(
'targets',
nargs='+',
help='DVC files.')
nargs='*',
help="DVC files. 'Dvcfile' by default.")
pipeline_show_parser.set_defaults(func=CmdPipelineShow)
args = parser.parse_args(argv)
if args.cmd == 'repro' and len(args.targets) == 0:
path = os.path.join(args.cwd, 'Dvcfile')
if (issubclass(args.func, CmdRepro)
or issubclass(args.func, CmdPipelineShow)) \
and hasattr(args, 'targets') \
and len(args.targets) == 0:
if hasattr(args, 'cwd'):
cwd = args.cwd
else:
cwd = os.curdir
path = os.path.join(cwd, 'Dvcfile')
if not os.path.exists(path):
msg = "error: default target '{}' does not exist.\n"
sys.stderr.write(msg.format(path))