Documentation
¶
Overview ¶
Package climain implements a command's main function.
You should invoke the Run function from the main function of your program.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run runs the main function for the given command with the given ExitFunc and arguments.
The `cmd` argument represents the command to run. We will specifically invoke the Main method of the cliutils.Command and exit (through `exitfn`) with 1 on error.
The `exitfn` argument is the function to call when exiting the program, which is mockable so to more easily write unit tests.
The `argv` arguments contain the command line arguments for the command.
This function will automatically install a signal handler for syscall.SIGINT that will cancel the contect passed to cliutils.Commnd when receiving a signal.