cli
cli copied to clipboard
How to set the default setting
While I run .go file via Cli, I need key in "run web" command to start the web server. My question is how to set the default setting, so that the web server will start running automaticlly when I execute a .go file?
Hi @mingyard,
This is possible by pulling the command definition out and setting it as both the app.Action as well as the Action for the subcommand (see example on https://github.com/urfave/cli/issues/657).
Hope this helps!
Oh, it does work. Cheers :)
Great! Thanks @mingyard