Skip to content

Commit

Permalink
cli/run: Require either --executable or --program
Browse files Browse the repository at this point in the history
This prevents a crash when "bottles-cli run" is invoked without
an --executable or --program.
  • Loading branch information
guihkx committed Nov 16, 2024
1 parent e93cd18 commit b294571
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bottles/frontend/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ def run_program(self):
bottle = mng.local_bottles[_bottle]
programs = mng.get_programs(bottle)

if _executable is None and _program is None:
sys.stderr.write(f"Please specify either --executable or --program\n")
exit(1)

if _program is not None:
if _executable is not None:
sys.stderr.write(f"Cannot specify both --program and --executable\n")
Expand Down

0 comments on commit b294571

Please sign in to comment.