MCPcopy Index your code
hub / github.com/ekalinin/nodeenv / parse_args

Function parse_args

nodeenv.py:378–406  ·  view source on GitHub ↗

Parses command line arguments. Set `check` to False to skip validation checks.

(check=True)

Source from the content-addressed store, hash-verified

376
377
378def parse_args(check=True):
379 """
380 Parses command line arguments.
381
382 Set `check` to False to skip validation checks.
383 """
384 parser = make_parser()
385 args = parser.parse_args()
386
387 if args.config_file is None:
388 args.config_file = ["./tox.ini", "./setup.cfg", "~/.nodeenvrc"]
389 elif not args.config_file:
390 args.config_file = []
391 else:
392 # Make sure that explicitly provided files exist
393 if not os.path.exists(args.config_file):
394 parser.error("Config file '{0}' doesn't exist!".format(
395 args.config_file))
396 args.config_file = [args.config_file]
397
398 if not check:
399 return args
400
401 if not args.list:
402 if not args.python_virtualenv and not args.env_dir:
403 parser.error('You must provide a DEST_DIR or '
404 'use current python virtualenv')
405
406 return args
407
408
409def mkdir(path):

Callers 1

mainFunction · 0.85

Calls 1

make_parserFunction · 0.85

Tested by

no test coverage detected