mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +08:00
Merge pull request #1886 from edsantiago/pypod_run_args
pypod run: ignore args intended for container command
This commit is contained in:
@ -21,7 +21,7 @@ class Create(AbstractActionBase):
|
||||
parser.add_argument('image', nargs=1, help='source image id')
|
||||
parser.add_argument(
|
||||
'command',
|
||||
nargs='*',
|
||||
nargs=parent.REMAINDER,
|
||||
help='command and args to run.',
|
||||
)
|
||||
parser.set_defaults(class_=cls, method='create')
|
||||
|
@ -21,7 +21,7 @@ class Run(AbstractActionBase):
|
||||
parser.add_argument('image', nargs=1, help='source image id.')
|
||||
parser.add_argument(
|
||||
'command',
|
||||
nargs='*',
|
||||
nargs=parent.REMAINDER,
|
||||
help='command and args to run.',
|
||||
)
|
||||
parser.set_defaults(class_=cls, method='run')
|
||||
|
@ -97,6 +97,8 @@ class PodmanArgumentParser(argparse.ArgumentParser):
|
||||
|
||||
actions_parser = self.add_subparsers(
|
||||
dest='subparser_name', help='commands')
|
||||
# For create/exec/run: don't process options intended for subcommand
|
||||
actions_parser.REMAINDER = argparse.REMAINDER
|
||||
|
||||
# import buried here to prevent import loops
|
||||
import pypodman.lib.actions # pylint: disable=cyclic-import
|
||||
|
Reference in New Issue
Block a user