From 370301a702b23230a4457a369bd7ab8504f3a24a Mon Sep 17 00:00:00 2001 From: Michal Konečný Date: Feb 22 2021 16:23:43 +0000 Subject: Add --config argument Signed-off-by: Michal Konečný --- diff --git a/src/centpkg/__main__.py b/src/centpkg/__main__.py index 2f28cf0..c394ae3 100644 --- a/src/centpkg/__main__.py +++ b/src/centpkg/__main__.py @@ -35,13 +35,16 @@ def main(): parser.add_argument('-S', '--sig', help='Operate as a CentOS SIG user instead of using the Stream distro environment', default=False, action='store_true') + parser.add_argument('-C', '--config', help='Specify a config file to use') + (args, other) = parser.parse_known_args() - if args.sig: - args.config = '/etc/rpkg/centpkg-sig.conf' - else: - args.config = '/etc/rpkg/centpkg.conf' + if not args.config: + if args.sig: + args.config = '/etc/rpkg/centpkg-sig.conf' + else: + args.config = '/etc/rpkg/centpkg.conf' # Make sure we have a sane config file if not os.path.exists(args.config) and not other[-1] in ['--help', '-h', 'help']: