diff --git a/dcc/eureka.py b/dcc/eureka.py index ed049e3..d147879 100644 --- a/dcc/eureka.py +++ b/dcc/eureka.py @@ -4,16 +4,18 @@ import subprocess class Eureka(dcc.doom_base.WadMap): + def get_parser(self, prog_name): + parser = super().get_parser(prog_name) + parser.add_argument("--main") + return parser + def take_action(self, parsed_args): iwad = self.iwad_path(parsed_args.wad) pwadpath = self.pwads.joinpath(parsed_args.wad) - mw = list(pwadpath.glob( - '*{}*.wad'.format(parsed_args.wad), case_sensitive=False - )) - if len(mw) != 1: - raise Exception( - f"Unable to guess at main pwad for wad {parsed_args.wad}." - ) + if parsed_args.main is not None: + mw = pwadpath.joinpath(parsed_args.main) + else: + mw = sorted(list(pwadpath.glob('*.wad', case_sensitive=False)))[0] complevel = self.complevel() port = "vanilla" @@ -24,5 +26,5 @@ class Eureka(dcc.doom_base.WadMap): subprocess.run( ["eureka"] + ["-iwad", iwad] + ["-w", parsed_args.map] - + ["-p", port] + [mw[0]] + + ["-p", port] + [mw] )