Skip to content

Commit 5c6dd3c

Browse files
committed
🎉 init zut
0 parents  commit 5c6dd3c

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

cmd/root.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package command
2+
3+
import (
4+
"fmt"
5+
"os"
6+
7+
"github.com/spf13/cobra"
8+
)
9+
10+
// NewRootCommand creates the root command for the Zut CLI
11+
func NewRootCommand() *cobra.Command {
12+
cmd := &cobra.Command{
13+
Use: "zut",
14+
Short: "Zut - CLI for storing, retrieving shell commands.",
15+
Long: "Zut fast, simple, and effective CLI for storing, retrieving, & executing frequently used or complex shell commands.",
16+
}
17+
18+
return cmd
19+
}
20+
21+
// Execute adds all child commands to the root command and sets flags appropriately.
22+
func Execute() {
23+
rootCmd := NewRootCommand()
24+
25+
if err := rootCmd.Execute(); err != nil {
26+
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
27+
os.Exit(1)
28+
}
29+
}

go.mod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module github.com/geekloper/zut
2+
3+
go 1.23.6
4+
5+
require github.com/spf13/cobra v1.10.1
6+
7+
require (
8+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
9+
github.com/spf13/pflag v1.0.9 // indirect
10+
)

go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
2+
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
3+
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
4+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
5+
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
6+
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
7+
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
8+
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
9+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
10+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import command "github.com/geekloper/zut/cmd"
4+
5+
func main() {
6+
command.Execute()
7+
}

0 commit comments

Comments
 (0)