Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsVerbose ¶
IsVerbose checks if the "verbose" flag is set for the given Cobra command. It first checks if the verbose flag is explicitly set on the command. If not, it falls back to the config value using viper.
Parameters:
- cmd: A pointer to a Cobra command from which the "verbose" flag is retrieved.
Returns:
- bool: True if the "verbose" flag is set to true, otherwise false.
func StartChildProcess ¶
StartChildProcess starts a child process with the given exec.Cmd configuration. It sets up the standard input, output, and error streams to be the same as the parent process. Additionally, it captures interrupt signals (ctl + c) and forwards them to the child process.
Parameters:
- c: A pointer to an exec.Cmd struct representing the command to be executed.
Returns:
- error: An error if the command fails to start or exits with a non-zero status. Returns nil if the command completes successfully.
The function starts the command and waits for it to finish.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.