Skip to content

Commit

Permalink
hook up datamodel cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed May 25, 2020
1 parent 0a7dec9 commit 93a3833
Showing 39 changed files with 700 additions and 503 deletions.
9 changes: 4 additions & 5 deletions .hof/shadow/Cli/cmd/hof/cmd/datamodel.go
Original file line number Diff line number Diff line change
@@ -53,13 +53,12 @@ func init() {
DatamodelCmd.SetHelpFunc(thelp)
DatamodelCmd.SetUsageFunc(tusage)

DatamodelCmd.AddCommand(cmddatamodel.ViewCmd)
DatamodelCmd.AddCommand(cmddatamodel.ListCmd)
DatamodelCmd.AddCommand(cmddatamodel.GetCmd)
DatamodelCmd.AddCommand(cmddatamodel.StatusCmd)
DatamodelCmd.AddCommand(cmddatamodel.GraphCmd)
DatamodelCmd.AddCommand(cmddatamodel.VisualizeCmd)
DatamodelCmd.AddCommand(cmddatamodel.DiffCmd)
DatamodelCmd.AddCommand(cmddatamodel.HistoryCmd)
DatamodelCmd.AddCommand(cmddatamodel.MigrateCmd)
DatamodelCmd.AddCommand(cmddatamodel.TestCmd)
DatamodelCmd.AddCommand(cmddatamodel.DeleteCmd)
DatamodelCmd.AddCommand(cmddatamodel.ApplyCmd)

}
Original file line number Diff line number Diff line change
@@ -11,23 +11,23 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var listLong = `list the known modelsets`
var applyLong = `apply a migraion sequence against a data store`

func ListRun(args []string) (err error) {
func ApplyRun(args []string) (err error) {

// you can safely comment this print out
fmt.Println("not implemented")

return err
}

var ListCmd = &cobra.Command{
var ApplyCmd = &cobra.Command{

Use: "list",
Use: "apply",

Short: "list the known modelsets",
Short: "apply a migraion sequence against a data store",

Long: listLong,
Long: applyLong,

PreRun: func(cmd *cobra.Command, args []string) {

@@ -42,7 +42,7 @@ var ListCmd = &cobra.Command{

// Argument Parsing

err = ListRun(args)
err = ApplyRun(args)
if err != nil {
fmt.Println(err)
os.Exit(1)
@@ -52,8 +52,8 @@ var ListCmd = &cobra.Command{

func init() {

help := ListCmd.HelpFunc()
usage := ListCmd.UsageFunc()
help := ApplyCmd.HelpFunc()
usage := ApplyCmd.UsageFunc()

thelp := func(cmd *cobra.Command, args []string) {
cs := strings.Fields(cmd.CommandPath())
@@ -67,7 +67,7 @@ func init() {
ga.SendGaEvent(c+"/usage", "<omit>", 0)
return usage(cmd)
}
ListCmd.SetHelpFunc(thelp)
ListCmd.SetUsageFunc(tusage)
ApplyCmd.SetHelpFunc(thelp)
ApplyCmd.SetUsageFunc(tusage)

}
4 changes: 2 additions & 2 deletions .hof/shadow/Cli/cmd/hof/cmd/datamodel/diff.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var diffLong = `show the current diff for a modelset`
var diffLong = `show the current diff for a data model`

func DiffRun(args []string) (err error) {

@@ -25,7 +25,7 @@ var DiffCmd = &cobra.Command{

Use: "diff",

Short: "show the current diff for a modelset",
Short: "show the current diff for a data model",

Long: diffLong,

Original file line number Diff line number Diff line change
@@ -11,23 +11,23 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var listLong = `list the known modelsets`
var getLong = `find and display data models`

func ListRun(args []string) (err error) {
func GetRun(args []string) (err error) {

// you can safely comment this print out
fmt.Println("not implemented")

return err
}

var ListCmd = &cobra.Command{
var GetCmd = &cobra.Command{

Use: "list",
Use: "get",

Short: "list the known modelsets",
Short: "find and display data models",

Long: listLong,
Long: getLong,

PreRun: func(cmd *cobra.Command, args []string) {

@@ -42,7 +42,7 @@ var ListCmd = &cobra.Command{

// Argument Parsing

err = ListRun(args)
err = GetRun(args)
if err != nil {
fmt.Println(err)
os.Exit(1)
@@ -52,8 +52,8 @@ var ListCmd = &cobra.Command{

func init() {

help := ListCmd.HelpFunc()
usage := ListCmd.UsageFunc()
help := GetCmd.HelpFunc()
usage := GetCmd.UsageFunc()

thelp := func(cmd *cobra.Command, args []string) {
cs := strings.Fields(cmd.CommandPath())
@@ -67,7 +67,7 @@ func init() {
ga.SendGaEvent(c+"/usage", "<omit>", 0)
return usage(cmd)
}
ListCmd.SetHelpFunc(thelp)
ListCmd.SetUsageFunc(tusage)
GetCmd.SetHelpFunc(thelp)
GetCmd.SetUsageFunc(tusage)

}
Original file line number Diff line number Diff line change
@@ -11,23 +11,23 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var graphLong = `show the relationship graph for a modelset`
var historyLong = `show the history for a data model`

func GraphRun(args []string) (err error) {
func HistoryRun(args []string) (err error) {

// you can safely comment this print out
fmt.Println("not implemented")

return err
}

var GraphCmd = &cobra.Command{
var HistoryCmd = &cobra.Command{

Use: "graph",
Use: "history",

Short: "show the relationship graph for a modelset",
Short: "show the history for a data model",

Long: graphLong,
Long: historyLong,

PreRun: func(cmd *cobra.Command, args []string) {

@@ -42,7 +42,7 @@ var GraphCmd = &cobra.Command{

// Argument Parsing

err = GraphRun(args)
err = HistoryRun(args)
if err != nil {
fmt.Println(err)
os.Exit(1)
@@ -52,8 +52,8 @@ var GraphCmd = &cobra.Command{

func init() {

help := GraphCmd.HelpFunc()
usage := GraphCmd.UsageFunc()
help := HistoryCmd.HelpFunc()
usage := HistoryCmd.UsageFunc()

thelp := func(cmd *cobra.Command, args []string) {
cs := strings.Fields(cmd.CommandPath())
@@ -67,7 +67,7 @@ func init() {
ga.SendGaEvent(c+"/usage", "<omit>", 0)
return usage(cmd)
}
GraphCmd.SetHelpFunc(thelp)
GraphCmd.SetUsageFunc(tusage)
HistoryCmd.SetHelpFunc(thelp)
HistoryCmd.SetUsageFunc(tusage)

}
4 changes: 2 additions & 2 deletions .hof/shadow/Cli/cmd/hof/cmd/datamodel/migrate.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var migrateLong = `create the next migration for a modelset`
var migrateLong = `calculate a changeset for a data model`

func MigrateRun(args []string) (err error) {

@@ -25,7 +25,7 @@ var MigrateCmd = &cobra.Command{

Use: "migrate",

Short: "create the next migration for a modelset",
Short: "calculate a changeset for a data model",

Long: migrateLong,

4 changes: 2 additions & 2 deletions .hof/shadow/Cli/cmd/hof/cmd/datamodel/status.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var statusLong = `show the current status for a modelset`
var statusLong = `print the data model status`

func StatusRun(args []string) (err error) {

@@ -25,7 +25,7 @@ var StatusCmd = &cobra.Command{

Use: "status",

Short: "show the current status for a modelset",
Short: "print the data model status",

Long: statusLong,

73 changes: 0 additions & 73 deletions .hof/shadow/Cli/cmd/hof/cmd/datamodel/view.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -11,23 +11,23 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var deleteLong = `delete a modelset permentantly`
var visualizeLong = `visualize a data model`

func DeleteRun(args []string) (err error) {
func VisualizeRun(args []string) (err error) {

// you can safely comment this print out
fmt.Println("not implemented")

return err
}

var DeleteCmd = &cobra.Command{
var VisualizeCmd = &cobra.Command{

Use: "delete",
Use: "visualize",

Short: "delete a modelset permentantly",
Short: "visualize a data model",

Long: deleteLong,
Long: visualizeLong,

PreRun: func(cmd *cobra.Command, args []string) {

@@ -42,7 +42,7 @@ var DeleteCmd = &cobra.Command{

// Argument Parsing

err = DeleteRun(args)
err = VisualizeRun(args)
if err != nil {
fmt.Println(err)
os.Exit(1)
@@ -52,8 +52,8 @@ var DeleteCmd = &cobra.Command{

func init() {

help := DeleteCmd.HelpFunc()
usage := DeleteCmd.UsageFunc()
help := VisualizeCmd.HelpFunc()
usage := VisualizeCmd.UsageFunc()

thelp := func(cmd *cobra.Command, args []string) {
cs := strings.Fields(cmd.CommandPath())
@@ -67,7 +67,7 @@ func init() {
ga.SendGaEvent(c+"/usage", "<omit>", 0)
return usage(cmd)
}
DeleteCmd.SetHelpFunc(thelp)
DeleteCmd.SetUsageFunc(tusage)
VisualizeCmd.SetHelpFunc(thelp)
VisualizeCmd.SetUsageFunc(tusage)

}
5 changes: 3 additions & 2 deletions .hof/shadow/Cli/cmd/hof/cmd/info.go
Original file line number Diff line number Diff line change
@@ -19,8 +19,9 @@ var infoLong = `print information about known resources`

func init() {

InfoCmd.Flags().BoolVarP(&(flags.InfoFlags.Builtin), "builtin", "b", false, "Only print builtin resources")
InfoCmd.Flags().BoolVarP(&(flags.InfoFlags.Custom), "custom", "c", false, "Only print custom resources")
InfoCmd.Flags().BoolVarP(&(flags.InfoFlags.Builtin), "builtin", "", false, "Only print builtin resources")
InfoCmd.Flags().BoolVarP(&(flags.InfoFlags.Custom), "custom", "", false, "Only print custom resources")
InfoCmd.Flags().BoolVarP(&(flags.InfoFlags.Local), "here", "", false, "Only print workspace resources")
}

func InfoRun(args []string) (err error) {
Loading

0 comments on commit 93a3833

Please sign in to comment.