File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,7 +451,41 @@ def _launch_main():
451451 return 1
452452
453453
454+ # Click-based CLI to allow launching BCASL-only Studio from the root entry
455+ try :
456+ import click
457+
458+ @click .group (invoke_without_command = True , context_settings = {"help_option_names" : ["-h" , "--help" ]})
459+ @click .option ("--bcasl-only" , is_flag = True , help = "Launch BCASL Studio (Standalone)" )
460+ @click .pass_context
461+ def cli (ctx : click .Context , bcasl_only : bool ):
462+ """PyCompiler ARK++ CLI."""
463+ if ctx .invoked_subcommand is None :
464+ if bcasl_only :
465+ from bcasl .only_mod .app import run as run_bcasl
466+ rc = run_bcasl (sys .argv )
467+ raise SystemExit (rc )
468+ else :
469+ rc = main (sys .argv )
470+ raise SystemExit (rc )
471+
472+ @cli .command (name = "bcasl" )
473+ def cli_bcasl ():
474+ """Launch BCASL Studio (Standalone)."""
475+ from bcasl .only_mod .app import run as run_bcasl
476+ rc = run_bcasl (sys .argv )
477+ raise SystemExit (rc )
478+
479+ except Exception :
480+ # Fallback CLI if click isn't available
481+ def cli (): # type: ignore
482+ if any (arg in ("--bcasl-only" , "bcasl" ) for arg in sys .argv [1 :]):
483+ from bcasl .only_mod .app import run as run_bcasl
484+ rc = run_bcasl (sys .argv )
485+ raise SystemExit (rc )
486+ rc = main (sys .argv )
487+ raise SystemExit (rc )
488+
489+
454490if __name__ == "__main__" :
455- import multiprocessing
456- multiprocessing .set_start_method ("spawn" , force = True )
457- sys .exit (main (sys .argv ))
491+ cli ()
You can’t perform that action at this time.
0 commit comments