mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-29 19:33:48 +01:00
#335: report version with -v
This commit is contained in:
parent
4a5fd23a2e
commit
b6a9f8efd4
@ -1150,12 +1150,16 @@ class PodmanCompose:
|
|||||||
for cmd_parser in cmd._parse_args:
|
for cmd_parser in cmd._parse_args:
|
||||||
cmd_parser(subparser)
|
cmd_parser(subparser)
|
||||||
self.global_args = parser.parse_args()
|
self.global_args = parser.parse_args()
|
||||||
|
if self.global_args.version:
|
||||||
|
self.global_args.command = "version"
|
||||||
if not self.global_args.command or self.global_args.command=='help':
|
if not self.global_args.command or self.global_args.command=='help':
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
exit(-1)
|
exit(-1)
|
||||||
return self.global_args
|
return self.global_args
|
||||||
|
|
||||||
def _init_global_parser(self, parser):
|
def _init_global_parser(self, parser):
|
||||||
|
parser.add_argument("-v", "--version",
|
||||||
|
help="show version", action='store_true')
|
||||||
parser.add_argument("-f", "--file",
|
parser.add_argument("-f", "--file",
|
||||||
help="Specify an alternate compose file (default: docker-compose.yml)",
|
help="Specify an alternate compose file (default: docker-compose.yml)",
|
||||||
metavar='file', action='append', default=[])
|
metavar='file', action='append', default=[])
|
||||||
|
Loading…
Reference in New Issue
Block a user