How to use the gitman.commands function in gitman

To help you get started, we’ve selected a few gitman examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jacebrowning / gitman / gitman / cli.py View on Github external
def _get_command(function, namespace):  # pylint: disable=too-many-statements
    args: List = []
    kwargs: Dict = {}

    if namespace.command == 'init':
        function = commands.init

    elif namespace.command in ['install', 'update']:
        function = getattr(commands, namespace.command)
        args = namespace.name
        kwargs.update(
            root=namespace.root,
            depth=namespace.depth,
            force=namespace.force,
            force_interactive=namespace.force_interactive,
            clean=namespace.clean,
            skip_changes=namespace.skip_changes,
        )
        if namespace.command == 'install':
            kwargs.update(fetch=namespace.fetch)
        if namespace.command == 'update':
            kwargs.update(recurse=namespace.recurse, lock=namespace.lock)

    elif namespace.command == 'list':
        function = commands.display
github jacebrowning / gitman / gitman / cli.py View on Github external
def _get_command(function, namespace):  # pylint: disable=too-many-statements
    args: List = []
    kwargs: Dict = {}

    if namespace.command == 'init':
        function = commands.init

    elif namespace.command in ['install', 'update']:
        function = getattr(commands, namespace.command)
        args = namespace.name
        kwargs.update(
            root=namespace.root,
            depth=namespace.depth,
            force=namespace.force,
            force_interactive=namespace.force_interactive,
            clean=namespace.clean,
            skip_changes=namespace.skip_changes,
        )
        if namespace.command == 'install':
            kwargs.update(fetch=namespace.fetch)
        if namespace.command == 'update':
            kwargs.update(recurse=namespace.recurse, lock=namespace.lock)
github jacebrowning / gitman / gitman / cli.py View on Github external
elif namespace.command == 'list':
        function = commands.display
        kwargs.update(
            root=namespace.root,
            depth=namespace.depth,
            allow_dirty=namespace.allow_dirty,
        )

    elif namespace.command == 'lock':
        function = getattr(commands, namespace.command)
        args = namespace.name
        kwargs.update(root=namespace.root)

    elif namespace.command == 'uninstall':
        function = commands.delete
        kwargs.update(
            root=namespace.root,
            force=namespace.force,
            keep_location=namespace.keep_location,
        )

    elif namespace.command == 'show':
        function = commands.show
        args = namespace.name
        kwargs.update(root=namespace.root)
        if namespace.config:
            args.append('__config__')
        if namespace.log:
            args.append('__log__')

    elif namespace.command == 'edit':
github jacebrowning / gitman / gitman / cli.py View on Github external
elif namespace.command == 'lock':
        function = getattr(commands, namespace.command)
        args = namespace.name
        kwargs.update(root=namespace.root)

    elif namespace.command == 'uninstall':
        function = commands.delete
        kwargs.update(
            root=namespace.root,
            force=namespace.force,
            keep_location=namespace.keep_location,
        )

    elif namespace.command == 'show':
        function = commands.show
        args = namespace.name
        kwargs.update(root=namespace.root)
        if namespace.config:
            args.append('__config__')
        if namespace.log:
            args.append('__log__')

    elif namespace.command == 'edit':
        function = commands.edit
        kwargs.update(root=namespace.root)

    return function, args, kwargs
github jacebrowning / gitman / gitman / cli.py View on Github external
root=namespace.root,
            force=namespace.force,
            keep_location=namespace.keep_location,
        )

    elif namespace.command == 'show':
        function = commands.show
        args = namespace.name
        kwargs.update(root=namespace.root)
        if namespace.config:
            args.append('__config__')
        if namespace.log:
            args.append('__log__')

    elif namespace.command == 'edit':
        function = commands.edit
        kwargs.update(root=namespace.root)

    return function, args, kwargs
github jacebrowning / gitman / gitman / cli.py View on Github external
args = namespace.name
        kwargs.update(
            root=namespace.root,
            depth=namespace.depth,
            force=namespace.force,
            force_interactive=namespace.force_interactive,
            clean=namespace.clean,
            skip_changes=namespace.skip_changes,
        )
        if namespace.command == 'install':
            kwargs.update(fetch=namespace.fetch)
        if namespace.command == 'update':
            kwargs.update(recurse=namespace.recurse, lock=namespace.lock)

    elif namespace.command == 'list':
        function = commands.display
        kwargs.update(
            root=namespace.root,
            depth=namespace.depth,
            allow_dirty=namespace.allow_dirty,
        )

    elif namespace.command == 'lock':
        function = getattr(commands, namespace.command)
        args = namespace.name
        kwargs.update(root=namespace.root)

    elif namespace.command == 'uninstall':
        function = commands.delete
        kwargs.update(
            root=namespace.root,
            force=namespace.force,