Created new Golang program

This commit is contained in:
Gregory Ballantine
2018-07-14 13:49:16 -04:00
parent e38b263e57
commit bd24d89628
11 changed files with 130 additions and 1155 deletions

24
cmd/root.go Normal file
View File

@ -0,0 +1,24 @@
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "muldap",
Short: "muldap is Metaunix.net's LDAP management tool",
Long: "LDAP management tool for Metaunix.net user and group resources.",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Metaunix.net LDAP tool - available commands are: version")
},
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}

20
cmd/version.go Normal file
View File

@ -0,0 +1,20 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(versionCmd)
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of muldap",
Long: `All software has versions. This is muldap's`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Metaunix.net LDAP tool v0.1.0")
},
}