From cb97f0cad4f27057edf28a129b396a7c8b6525ac Mon Sep 17 00:00:00 2001 From: bth Date: Sat, 13 Jan 2024 11:51:01 -0800 Subject: [PATCH] delete go cli --- LICENSE | 0 cmd/cat.go | 40 ------------------------------------- cmd/last.go | 40 ------------------------------------- cmd/next.go | 55 --------------------------------------------------- cmd/rename.go | 40 ------------------------------------- cmd/root.go | 51 ----------------------------------------------- go.mod | 10 ---------- go.sum | 10 ---------- main.go | 11 ----------- 9 files changed, 257 deletions(-) delete mode 100644 LICENSE delete mode 100644 cmd/cat.go delete mode 100644 cmd/last.go delete mode 100644 cmd/next.go delete mode 100644 cmd/rename.go delete mode 100644 cmd/root.go delete mode 100644 go.mod delete mode 100644 go.sum delete mode 100644 main.go diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e69de29..0000000 diff --git a/cmd/cat.go b/cmd/cat.go deleted file mode 100644 index a573b70..0000000 --- a/cmd/cat.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright © 2024 NAME HERE - -*/ -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -// catCmd represents the cat command -var catCmd = &cobra.Command{ - Use: "cat", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("cat called") - }, -} - -func init() { - rootCmd.AddCommand(catCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // catCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // catCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -} diff --git a/cmd/last.go b/cmd/last.go deleted file mode 100644 index e2814da..0000000 --- a/cmd/last.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright © 2024 NAME HERE - -*/ -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -// lastCmd represents the last command -var lastCmd = &cobra.Command{ - Use: "last", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("last called") - }, -} - -func init() { - rootCmd.AddCommand(lastCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // lastCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // lastCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -} diff --git a/cmd/next.go b/cmd/next.go deleted file mode 100644 index 8aa1a2c..0000000 --- a/cmd/next.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright © 2024 NAME HERE - -*/ -package cmd - -import ( - "fmt" - "github.com/spf13/cobra" - "os/exec" -) - -// nextCmd represents the next command -var nextCmd = &cobra.Command{ - Use: "next", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("next called") - // shcmd := exec.Command("", "/home/bth/dev/um/bash/next/next.sh") - - // create a new *Cmd instance - // command as the first arg, arguments as remaining args - lscmd := exec.Command("ls") - - // The `Output` method executes the command and - // collects the output, returning its value - out, err := lscmd.Output() - if err != nil { - // if there was any error, print it here - fmt.Println("could not run command: ", err) - } - // otherwise, print the output from running the command - fmt.Println("Output: ", string(out)) - }, -} - -func init() { - rootCmd.AddCommand(nextCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // nextCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // nextCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -} diff --git a/cmd/rename.go b/cmd/rename.go deleted file mode 100644 index 0347824..0000000 --- a/cmd/rename.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright © 2024 NAME HERE - -*/ -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -// renameCmd represents the rename command -var renameCmd = &cobra.Command{ - Use: "rename", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("rename called") - }, -} - -func init() { - rootCmd.AddCommand(renameCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // renameCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // renameCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -} diff --git a/cmd/root.go b/cmd/root.go deleted file mode 100644 index b4e9154..0000000 --- a/cmd/root.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright © 2024 NAME HERE - -*/ -package cmd - -import ( - "os" - - "github.com/spf13/cobra" -) - - - -// rootCmd represents the base command when called without any subcommands -var rootCmd = &cobra.Command{ - Use: "um", - Short: "A brief description of your application", - Long: `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, - // Uncomment the following line if your bare application - // has an action associated with it: - // Run: func(cmd *cobra.Command, args []string) { }, -} - -// Execute adds all child commands to the root command and sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. -func Execute() { - err := rootCmd.Execute() - if err != nil { - os.Exit(1) - } -} - -func init() { - // Here you will define your flags and configuration settings. - // Cobra supports persistent flags, which, if defined here, - // will be global for your application. - - // rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.um.yaml)") - - // Cobra also supports local flags, which will only run - // when this action is called directly. - rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -} - - diff --git a/go.mod b/go.mod deleted file mode 100644 index 814f408..0000000 --- a/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/brtholomy/um - -go 1.21.3 - -require github.com/spf13/cobra v1.8.0 - -require ( - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect -) diff --git a/go.sum b/go.sum deleted file mode 100644 index d0e8c2c..0000000 --- a/go.sum +++ /dev/null @@ -1,10 +0,0 @@ -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go deleted file mode 100644 index 8cde929..0000000 --- a/main.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -Copyright © 2024 NAME HERE - -*/ -package main - -import "github.com/brtholomy/um/cmd" - -func main() { - cmd.Execute() -}