Skip to content

Consider a less ad-hoc approach to CLI arguments #10

@teodorlu

Description

@teodorlu

Right now, we hand roll CLI arguments. We allow something like:

hotload PYTHON_MODULE_OR_SCRIPT [--entrypoint ENTRYPOINT_FUNCTION] [--recursive] [--no-clear]

But this isn't reflected in the helptext.

I know we have argparse -- but argparse can feel a bit heavy. I've used https://github.com/babashka/cli a bit recently, and I love how lightweight it is. Essentially, you specify the type of each option. The CLI lib can then return a map of all the options. Argparse might still be the way to go, not sure.

Current helptext output:

$ hotload
Running hotload ...
Usage: hotload SCRIPT
Hotload python script when files on standard input change

Example usage:

    find . -name '*.py' | hotload init.py

.py extension for script may be omitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions