datalad.cmdline.helpers

class datalad.cmdline.helpers.HelpAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

class datalad.cmdline.helpers.LogLevelAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

datalad.cmdline.helpers.get_repo_instance(path='.', class_=None)[source]

Returns an instance of appropriate datalad repository for path. Check whether a certain path is inside a known type of repository and returns an instance representing it. May also check for a certain type instead of detecting the type of repository.

Parameters:
  • path (str) – path to check; default: current working directory
  • class (class) – if given, check whether path is inside a repository, that can be represented as an instance of the passed class.
Raises:

RuntimeError, in case cwd is not inside a known repository.

datalad.cmdline.helpers.parser_add_common_opt(parser, opt, names=None, **kwargs)[source]
datalad.cmdline.helpers.run_via_pbs(args, pbs)[source]
datalad.cmdline.helpers.strip_arg_from_argv(args, value, opt_names)[source]

Strip an originally listed option (with its value) from the list cmdline args