From b6a9f8efd42d277d89e8c3eeb7e58b18418fe5a6 Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Thu, 9 Sep 2021 00:33:07 +0300 Subject: [PATCH] #335: report version with -v --- podman_compose.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/podman_compose.py b/podman_compose.py index beb71e7..969d223 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1150,12 +1150,16 @@ class PodmanCompose: for cmd_parser in cmd._parse_args: cmd_parser(subparser) 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': parser.print_help() exit(-1) return self.global_args def _init_global_parser(self, parser): + parser.add_argument("-v", "--version", + help="show version", action='store_true') parser.add_argument("-f", "--file", help="Specify an alternate compose file (default: docker-compose.yml)", metavar='file', action='append', default=[])