Skip to content

Commit

Permalink
fix: do no parse -- and subsequent arguments on the command line (#558)
Browse files Browse the repository at this point in the history
This allows a user to pass custom args that can be parsed in the
application.

click does not seem to support this:
pallets/click#619

But it is easy to work around by passing the args ourselves after
removing the -- and subsequent args.
  • Loading branch information
maartenbreddels committed Mar 18, 2024
1 parent 829946c commit e3ea88a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion solara/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,11 @@ def rename(path: Path):


def main():
cli()
args = sys.argv
# skip everything after -- if it exists
if "--" in args:
args = args[: args.index("--")]
cli(args[1:])


if __name__ == "__main__":
Expand Down

0 comments on commit e3ea88a

Please sign in to comment.