Skip to content

Commit

Permalink
Update __main__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Marysteph authored Oct 30, 2024
1 parent 9f4535c commit 625ee80
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kleborate/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ def parse_arguments(args, all_module_names, modules):
parser.print_help(file=sys.stderr)
sys.exit(1)

if '-o' not in args and '--outdir' not in args:
parsed_args = parser.parse_known_args(args)[0]

help_requested = any(
flag in args for flag in ('-h', '--help', '--help_all', '--version', '--list_modules')
)
if not help_requested and '-o' not in args and '--outdir' not in args:
sys.exit('Error: The --outdir (-o) option is required. Please specify an output directory.')

return parser.parse_args(args)
Expand Down

0 comments on commit 625ee80

Please sign in to comment.