Skip to content

Commit 841d021

Browse files
committed
fix: change --easy/-ez arg to proper boolean flag
- cli.py: Change --easy from type=str with broken '-ez' short option to action='store_true' The '-ez' multi-char short option caused argparse to parse it as -e and -z (both undefined), resulting in 'unrecognized arguments' error - gui.py: Same fix, remove '-E' short option, use action='store_true' - cmd_serve: Simplify easy_mode check to use boolean directly
1 parent 5275264 commit 841d021

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

advanced_rvc_inference/api/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def cmd_download(args):
675675

676676
def cmd_serve(args):
677677
"""Launch the web interface."""
678-
easy_mode = args.easy is not None and args.easy.lower() in ("true", "1", "yes")
678+
easy_mode = getattr(args, 'easy', False)
679679
mode_str = "Easy GUI" if easy_mode else "Full GUI"
680680
logger.info("Starting web interface (%s)...", mode_str)
681681

@@ -936,7 +936,7 @@ def create_parser():
936936
p.add_argument("--host", default="0.0.0.0", help="Host to bind (default: 0.0.0.0)")
937937
p.add_argument("--port", type=int, default=7860, help="Port to bind (default: 7860)")
938938
p.add_argument("--share", action="store_true", help="Create public share URL")
939-
p.add_argument("--easy", "-ez", type=str, default=None, help="Launch Easy GUI (simplified mode). Use 'true' to enable.")
939+
p.add_argument("--easy", action="store_true", help="Launch Easy GUI (simplified mode)")
940940
p.set_defaults(func=cmd_serve)
941941

942942
# ----- info -----

advanced_rvc_inference/app/gui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,9 @@ def create_app():
342342
parser.add_argument("--no-share", action="store_true", help="Disable public URL, use local access only")
343343
parser.add_argument("--open", action="store_true", help="Open in browser")
344344
parser.add_argument("--keep-alive", action="store_true", default=True, help="Keep tunnel alive (default: True)")
345-
parser.add_argument("--easy", "-E", type=str, default=None, help="Launch Easy GUI (simplified mode). Use 'true' to enable.")
345+
parser.add_argument("--easy", action="store_true", help="Launch Easy GUI (simplified mode)")
346346

347347
args = parser.parse_args()
348-
easy_mode = args.easy is not None and args.easy.lower() in ("true", "1", "yes")
349348

350349
sys.exit(
351350
launch(
@@ -354,6 +353,6 @@ def create_app():
354353
server_port=args.port,
355354
inbrowser=args.open,
356355
keep_alive=args.keep_alive,
357-
easy=easy_mode,
356+
easy=args.easy,
358357
)
359358
)

0 commit comments

Comments
 (0)