-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
several similar, main commands should be more consistemnt
- Loading branch information
Showing
94 changed files
with
2,944 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package cmddatamodel | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"strings" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/hofstadter-io/hof/cmd/hof/ga" | ||
) | ||
|
||
var createLong = `create data models` | ||
|
||
func CreateRun(args []string) (err error) { | ||
|
||
// you can safely comment this print out | ||
fmt.Println("not implemented") | ||
|
||
return err | ||
} | ||
|
||
var CreateCmd = &cobra.Command{ | ||
|
||
Use: "create", | ||
|
||
Aliases: []string{ | ||
"c", | ||
}, | ||
|
||
Short: "create data models", | ||
|
||
Long: createLong, | ||
|
||
PreRun: func(cmd *cobra.Command, args []string) { | ||
|
||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c, "<omit>", 0) | ||
|
||
}, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
var err error | ||
|
||
// Argument Parsing | ||
|
||
err = CreateRun(args) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
|
||
help := CreateCmd.HelpFunc() | ||
usage := CreateCmd.UsageFunc() | ||
|
||
thelp := func(cmd *cobra.Command, args []string) { | ||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c+"/help", "<omit>", 0) | ||
help(cmd, args) | ||
} | ||
tusage := func(cmd *cobra.Command) error { | ||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c+"/usage", "<omit>", 0) | ||
return usage(cmd) | ||
} | ||
CreateCmd.SetHelpFunc(thelp) | ||
CreateCmd.SetUsageFunc(tusage) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package cmddatamodel | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"strings" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/hofstadter-io/hof/cmd/hof/ga" | ||
) | ||
|
||
var deleteLong = `find and delete data models` | ||
|
||
func DeleteRun(args []string) (err error) { | ||
|
||
// you can safely comment this print out | ||
fmt.Println("not implemented") | ||
|
||
return err | ||
} | ||
|
||
var DeleteCmd = &cobra.Command{ | ||
|
||
Use: "delete", | ||
|
||
Aliases: []string{ | ||
"del", | ||
}, | ||
|
||
Short: "find and delete data models", | ||
|
||
Long: deleteLong, | ||
|
||
PreRun: func(cmd *cobra.Command, args []string) { | ||
|
||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c, "<omit>", 0) | ||
|
||
}, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
var err error | ||
|
||
// Argument Parsing | ||
|
||
err = DeleteRun(args) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
|
||
help := DeleteCmd.HelpFunc() | ||
usage := DeleteCmd.UsageFunc() | ||
|
||
thelp := func(cmd *cobra.Command, args []string) { | ||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c+"/help", "<omit>", 0) | ||
help(cmd, args) | ||
} | ||
tusage := func(cmd *cobra.Command) error { | ||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c+"/usage", "<omit>", 0) | ||
return usage(cmd) | ||
} | ||
DeleteCmd.SetHelpFunc(thelp) | ||
DeleteCmd.SetUsageFunc(tusage) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package cmddatamodel | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"strings" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/hofstadter-io/hof/cmd/hof/ga" | ||
) | ||
|
||
var editLong = `find and edit data models` | ||
|
||
func EditRun(args []string) (err error) { | ||
|
||
// you can safely comment this print out | ||
fmt.Println("not implemented") | ||
|
||
return err | ||
} | ||
|
||
var EditCmd = &cobra.Command{ | ||
|
||
Use: "edit", | ||
|
||
Aliases: []string{ | ||
"e", | ||
}, | ||
|
||
Short: "find and edit data models", | ||
|
||
Long: editLong, | ||
|
||
PreRun: func(cmd *cobra.Command, args []string) { | ||
|
||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c, "<omit>", 0) | ||
|
||
}, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
var err error | ||
|
||
// Argument Parsing | ||
|
||
err = EditRun(args) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
|
||
help := EditCmd.HelpFunc() | ||
usage := EditCmd.UsageFunc() | ||
|
||
thelp := func(cmd *cobra.Command, args []string) { | ||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c+"/help", "<omit>", 0) | ||
help(cmd, args) | ||
} | ||
tusage := func(cmd *cobra.Command) error { | ||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c+"/usage", "<omit>", 0) | ||
return usage(cmd) | ||
} | ||
EditCmd.SetHelpFunc(thelp) | ||
EditCmd.SetUsageFunc(tusage) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package cmddatamodel | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"strings" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/hofstadter-io/hof/cmd/hof/ga" | ||
) | ||
|
||
var setLong = `find and configure data models` | ||
|
||
func SetRun(args []string) (err error) { | ||
|
||
// you can safely comment this print out | ||
fmt.Println("not implemented") | ||
|
||
return err | ||
} | ||
|
||
var SetCmd = &cobra.Command{ | ||
|
||
Use: "set", | ||
|
||
Aliases: []string{ | ||
"s", | ||
}, | ||
|
||
Short: "find and configure data models", | ||
|
||
Long: setLong, | ||
|
||
PreRun: func(cmd *cobra.Command, args []string) { | ||
|
||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c, "<omit>", 0) | ||
|
||
}, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
var err error | ||
|
||
// Argument Parsing | ||
|
||
err = SetRun(args) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
|
||
help := SetCmd.HelpFunc() | ||
usage := SetCmd.UsageFunc() | ||
|
||
thelp := func(cmd *cobra.Command, args []string) { | ||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c+"/help", "<omit>", 0) | ||
help(cmd, args) | ||
} | ||
tusage := func(cmd *cobra.Command) error { | ||
cs := strings.Fields(cmd.CommandPath()) | ||
c := strings.Join(cs[1:], "/") | ||
ga.SendGaEvent(c+"/usage", "<omit>", 0) | ||
return usage(cmd) | ||
} | ||
SetCmd.SetHelpFunc(thelp) | ||
SetCmd.SetUsageFunc(tusage) | ||
|
||
} |
Oops, something went wrong.