Hacker News new | ask | show | jobs
by llanowarelves 1044 days ago
"If you define a MAIN function, any parameters you give it will be automatically turned into CLI flags."

This is actually cool

1 comments

What other languages do this? I love it
Practically any language that supports reflection has a library for that.
nushell[0] has this built-in. It's one of my favourite things about it.

Python has typer[1] to do this with type hints. It's limited and gets ugly quickly, but I love it for simple scripts.

[0] nushell.sh

[1] typer.tiangolo.com