risor-io / risor

Fast and flexible scripting for Go developers and DevOps.
https://risor.io
Apache License 2.0
581 stars 24 forks source link

cli module based on github.com/urfave/cli #182

Closed myzie closed 5 months ago

myzie commented 5 months ago

New cli module supports building full-featured CLIs in the Risor language.

Supports:

Use this specific shebang line at the start of script files: #!/usr/bin/env risor -- to ensure flags and args are passed through correctly.

Additional small enhancements in this PR:

#!/usr/bin/env risor --

from cli import app, command as c

app({
    name: "myapp",
    description: "My app description",
    commands: [
        command({
            name: "hello",
            description: "Say hello",
            action: func(ctx) {
                print("Hello, world!")
            },
        }),
    ],
}).run()
myzie commented 5 months ago

fyi @luisdavim @applejag @abadfox233 - you should give this a try!