We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fd1228d + dc65154 commit b5c7075Copy full SHA for b5c7075
util/cmd/root.go
@@ -143,5 +143,4 @@ func Execute() {
143
fmt.Println(err)
144
os.Exit(1)
145
}
146
- return
147
util/cmd/show.go
@@ -0,0 +1,27 @@
1
+package cmd
2
+
3
+import (
4
+ "fmt"
5
6
+ "github.com/spf13/cobra"
7
+)
8
9
+func init() {
10
+ rootCmd.AddCommand(showCmd)
11
+}
12
13
+var showCmd = &cobra.Command{
14
+ Use: "show",
15
+ Short: "Show hostnames in /etc/hosts",
16
+ Long: `Show the content of the /etc/hosts file `,
17
+ Args: func(cmd *cobra.Command, args []string) error {
18
+ return nil
19
+ },
20
+ Run: func(cmd *cobra.Command, args []string) {
21
+ ShowHosts()
22
23
24
25
+func ShowHosts() {
26
+ fmt.Print(etcHosts.RenderHostsFile())
27
0 commit comments