Пример #1
0
    def setup_cl_args(cls, parser):

        parser.add_argument(
            "spec",
            nargs="?",
            default=PTaskArea.current().spec,
            help="The production task specification."
        )

        parser.add_argument(
            "-s", "--shell", 
            default=ShellFormatters.default().name,
            choices=sorted([f.name for f in ShellFormatters.all()]),
            help="Shell type env commands should target."
        )

        parser.add_argument(
            "-p", "--previous", 
            nargs="?", 
            const="list",
            help="Choose a previous ptask env."
        )

        parser.add_argument(
            "-v", "--version", 
            type=int,
            help="The version of the ptask to print info for."
        )
Пример #2
0
    def __init__(self, spec, shell, previous=None, version=None):

        super(PTaskEnvAction, self).__init__(spec, shell, previous=previous)

        self._spec = spec
        self._shell = ShellFormatters.get(shell)
        self._previous = previous
        self._version = version
Пример #3
0
    def __init__(self, spec, shell, previous=None, version=None):

        super(PTaskEnvAction, self).__init__(
            spec, 
            shell, 
            previous=previous
        )

        self._spec = spec
        self._shell = ShellFormatters.get(shell)
        self._previous = previous
        self._version = version
Пример #4
0
    def setup_cl_args(cls, parser):

        parser.add_argument("spec",
                            nargs="?",
                            default=PTaskArea.current().spec,
                            help="The production task specification.")

        parser.add_argument("-s",
                            "--shell",
                            default=ShellFormatters.default().name,
                            choices=sorted(
                                [f.name for f in ShellFormatters.all()]),
                            help="Shell type env commands should target.")

        parser.add_argument("-p",
                            "--previous",
                            nargs="?",
                            const="list",
                            help="Choose a previous ptask env.")

        parser.add_argument("-v",
                            "--version",
                            type=int,
                            help="The version of the ptask to print info for.")