Add --config argument

Signed-off-by: Michal Konečný <mkonecny@redhat.com>
This commit is contained in:
Michal Konečný 2021-02-22 17:23:43 +01:00
parent 657b11d05a
commit 370301a702

View file

@ -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']: