Commit 8db31cf

Karn Wong <[email protected]>
2023-12-29 16:44:59
remove command title from printf
1 parent 88779b6
cmd/networking/networking_get_ip.go
@@ -9,7 +9,6 @@ import (
 	"net/http"
 	"strings"
 
-	"github.com/fatih/color"
 	"github.com/spf13/cobra"
 )
 
@@ -65,9 +64,8 @@ var getIPCmd = &cobra.Command{
 	Short: "Get IP information",
 	Long:  `Get IP information`,
 	Run: func(cmd *cobra.Command, args []string) {
-		color.Green("Networking: get-ip")
-		fmt.Printf("\tLocal IP   : %s\n", getLocalIP())
-		fmt.Printf("\tPublic IP  : %s\n", getPublicIP())
+		fmt.Printf("Local IP   : %s\n", getLocalIP())
+		fmt.Printf("Public IP  : %s\n", getPublicIP())
 	},
 }
 
cmd/security/security_generate_passphrase.go
@@ -7,7 +7,6 @@ import (
 
 	"github.com/kahnwong/swissknife/cmd/utils"
 
-	"github.com/fatih/color"
 	"github.com/sethvargo/go-diceware/diceware"
 	"github.com/spf13/cobra"
 )
@@ -30,8 +29,6 @@ var generatePassphraseCmd = &cobra.Command{
 	Long:  `Generate passphrase. Result is copied to clipboard.`,
 	Run: func(cmd *cobra.Command, args []string) {
 		// main
-		color.Green("Security: generate passphrase")
-
 		passphrase := generatePassphrase()
 		utils.CopyToClipboard(passphrase)
 		fmt.Printf("%s\n", passphrase)
cmd/security/security_generate_password.go
@@ -6,7 +6,6 @@ import (
 
 	"github.com/sethvargo/go-password/password"
 
-	"github.com/fatih/color"
 	"github.com/kahnwong/swissknife/cmd/utils"
 	"github.com/spf13/cobra"
 )
@@ -28,8 +27,6 @@ var generatePasswordCmd = &cobra.Command{
 	Long:  `Generate password. Result is copied to clipboard.`,
 	Run: func(cmd *cobra.Command, args []string) {
 		// main
-		color.Green("Security: generate password")
-
 		password := generatePassword()
 		utils.CopyToClipboard(password)
 		fmt.Printf("%s\n", password)
cmd/security/security_generate_ssh_key.go
@@ -12,7 +12,6 @@ import (
 
 	"golang.org/x/crypto/ssh"
 
-	"github.com/fatih/color"
 	"github.com/spf13/cobra"
 )
 
@@ -87,10 +86,8 @@ var generateSSHKeyCmd = &cobra.Command{
 		}
 
 		// main
-		color.Green("SSH: generate-ssh-key")
-
 		generateSSHKeyEDSA(args[0])
-		fmt.Printf("\tSSH key created at: %s\n", returnKeyPath(args[0]))
+		fmt.Printf("SSH key created at: %s\n", returnKeyPath(args[0]))
 	},
 }
 
go.mod
@@ -3,7 +3,6 @@ module github.com/kahnwong/swissknife
 go 1.20
 
 require (
-	github.com/fatih/color v1.15.0
 	github.com/sethvargo/go-diceware v0.3.0
 	github.com/sethvargo/go-password v0.2.0
 	github.com/spf13/cobra v1.7.0
@@ -13,8 +12,6 @@ require (
 
 require (
 	github.com/inconshreveable/mousetrap v1.1.0 // indirect
-	github.com/mattn/go-colorable v0.1.13 // indirect
-	github.com/mattn/go-isatty v0.0.17 // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
 	golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 // indirect
 	golang.org/x/image v0.6.0 // indirect
go.sum
@@ -1,14 +1,7 @@
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
-github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
-github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
 github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
-github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
-github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
-github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
-github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/sethvargo/go-diceware v0.3.0 h1:UVVEfmN/uF50JfWAN7nbY6CiAlp5xeSx+5U0lWKkMCQ=
 github.com/sethvargo/go-diceware v0.3.0/go.mod h1:lH5Q/oSPMivseNdhMERAC7Ti5oOPqsaVddU1BcN1CY0=
@@ -52,7 +45,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
 golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=