cli icon indicating copy to clipboard operation
cli copied to clipboard

How to set the default setting

Open mingyard opened this issue 8 years ago • 3 comments

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?

mingyard avatar Jan 15 '18 04:01 mingyard

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!

jszwedko avatar Jan 15 '18 04:01 jszwedko

Oh, it does work. Cheers :)

mingyard avatar Jan 15 '18 04:01 mingyard

Great! Thanks @mingyard

jszwedko avatar Jan 15 '18 04:01 jszwedko