Andrew
ee83586072
* Notifications now display errors and the output of the failed command. * CI configs for GitHub and Woodpecker * Added `version` subcommand * Console logging can be disabled by setting `console-disabled` in the `logging` object * If Host was not defined for an incomplete `hosts` object, any commands would fail as they could not look up the values in the SSH config files.
26 lines
314 B
Go
26 lines
314 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
const versionStr = "0.2.4"
|
|
|
|
var (
|
|
versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Prints the version and exits.",
|
|
Run: version,
|
|
}
|
|
)
|
|
|
|
func version(cmd *cobra.Command, args []string) {
|
|
|
|
fmt.Printf("v%s\n", versionStr)
|
|
|
|
os.Exit(0)
|
|
}
|