-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add hof/dm/log command for printing diff history; cleanup hof/dm subc…
…md aliases Signed-off-by: Tony Worm <tony@hofstadter.io>
- Loading branch information
Showing
11 changed files
with
166 additions
and
10 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
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,73 @@ | ||
package cmddatamodel | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var logLong = `show the current diff for a data model` | ||
|
||
func LogRun(args []string) (err error) { | ||
|
||
// you can safely comment this print out | ||
fmt.Println("not implemented") | ||
|
||
return err | ||
} | ||
|
||
var LogCmd = &cobra.Command{ | ||
|
||
Use: "log", | ||
|
||
Aliases: []string{ | ||
"l", | ||
}, | ||
|
||
Short: "show the current diff for a data model", | ||
|
||
Long: logLong, | ||
|
||
PreRun: func(cmd *cobra.Command, args []string) { | ||
|
||
}, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
var err error | ||
|
||
// Argument Parsing | ||
|
||
err = LogRun(args) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
extra := func(cmd *cobra.Command) bool { | ||
|
||
return false | ||
} | ||
|
||
ohelp := LogCmd.HelpFunc() | ||
ousage := LogCmd.UsageFunc() | ||
help := func(cmd *cobra.Command, args []string) { | ||
if extra(cmd) { | ||
return | ||
} | ||
ohelp(cmd, args) | ||
} | ||
usage := func(cmd *cobra.Command) error { | ||
if extra(cmd) { | ||
return nil | ||
} | ||
return ousage(cmd) | ||
} | ||
|
||
LogCmd.SetHelpFunc(help) | ||
LogCmd.SetUsageFunc(usage) | ||
|
||
} |
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
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,73 @@ | ||
package cmddatamodel | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var logLong = `show the current diff for a data model` | ||
|
||
func LogRun(args []string) (err error) { | ||
|
||
// you can safely comment this print out | ||
fmt.Println("not implemented") | ||
|
||
return err | ||
} | ||
|
||
var LogCmd = &cobra.Command{ | ||
|
||
Use: "log", | ||
|
||
Aliases: []string{ | ||
"l", | ||
}, | ||
|
||
Short: "show the current diff for a data model", | ||
|
||
Long: logLong, | ||
|
||
PreRun: func(cmd *cobra.Command, args []string) { | ||
|
||
}, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
var err error | ||
|
||
// Argument Parsing | ||
|
||
err = LogRun(args) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
extra := func(cmd *cobra.Command) bool { | ||
|
||
return false | ||
} | ||
|
||
ohelp := LogCmd.HelpFunc() | ||
ousage := LogCmd.UsageFunc() | ||
help := func(cmd *cobra.Command, args []string) { | ||
if extra(cmd) { | ||
return | ||
} | ||
ohelp(cmd, args) | ||
} | ||
usage := func(cmd *cobra.Command) error { | ||
if extra(cmd) { | ||
return nil | ||
} | ||
return ousage(cmd) | ||
} | ||
|
||
LogCmd.SetHelpFunc(help) | ||
LogCmd.SetUsageFunc(usage) | ||
|
||
} |
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