top | item 37043277 (no title) llanowarelves | 2 years ago "If you define a MAIN function, any parameters you give it will be automatically turned into CLI flags."This is actually cool discuss order hn newest lagniappe|2 years ago What other languages do this? I love it xmcqdpt2|2 years ago Scala 3 does it toohttps://docs.scala-lang.org/scala3/book/methods-main-methods... orthoxerox|2 years ago Practically any language that supports reflection has a library for that. dwb|2 years ago nushellhttps://www.nushell.sh/book/modules.html#mainhttps://www.nushell.sh/book/custom_commands.html#flags maleldil|2 years ago 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
lagniappe|2 years ago What other languages do this? I love it xmcqdpt2|2 years ago Scala 3 does it toohttps://docs.scala-lang.org/scala3/book/methods-main-methods... orthoxerox|2 years ago Practically any language that supports reflection has a library for that. dwb|2 years ago nushellhttps://www.nushell.sh/book/modules.html#mainhttps://www.nushell.sh/book/custom_commands.html#flags maleldil|2 years ago 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
xmcqdpt2|2 years ago Scala 3 does it toohttps://docs.scala-lang.org/scala3/book/methods-main-methods...
dwb|2 years ago nushellhttps://www.nushell.sh/book/modules.html#mainhttps://www.nushell.sh/book/custom_commands.html#flags
maleldil|2 years ago 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
lagniappe|2 years ago
xmcqdpt2|2 years ago
https://docs.scala-lang.org/scala3/book/methods-main-methods...
orthoxerox|2 years ago
dwb|2 years ago
https://www.nushell.sh/book/modules.html#main
https://www.nushell.sh/book/custom_commands.html#flags
maleldil|2 years ago
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