BrianPugh / cyclopts

Intuitive, easy CLIs based on python type hints.
Apache License 2.0
292 stars 7 forks source link

Example "Command Chaining" doesn't work #213

Closed dvp2015 closed 1 month ago

dvp2015 commented 1 month ago

The example "Command Chaining" in the online documentation doesn't work:

╭─ Error ──────────────────────────────────────────────────────────────────────╮
│ Unknown option: "--flag".                                                    │
╰──────────────────────────────────────────────────────────────────────────────╯

Process finished with exit code 1

The execution fails on argument parsing and doesn't reach 'main' function. Using main() directly

    # app.meta(["foo", "123", "AND", "foo", "456", "AND", "bar", "--flag"])
    main("foo", "123", "AND", "foo", "456", "AND", "bar", "--flag")

produces the expected result. But it looks like "app.meta()" is to be used in that case.

BrianPugh commented 1 month ago

Seems like those docs were a little stale; I updated them in #214 and they should work now. Thanks for opening this issue!