Skip to content

Commit

Permalink
make some things consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed May 24, 2020
1 parent db12049 commit f0e914f
Show file tree
Hide file tree
Showing 106 changed files with 1,063 additions and 455 deletions.
4 changes: 2 additions & 2 deletions .hof/shadow/Cli/cmd/hof/cmd/bisect.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var bisectLong = `Use binary search to find the commit that introduced a bug`
var bisectLong = `use binary search to find the commit that introduced a bug`

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

Expand All @@ -25,7 +25,7 @@ var BisectCmd = &cobra.Command{

Use: "bisect",

Short: "Use binary search to find the commit that introduced a bug",
Short: "use binary search to find the commit that introduced a bug",

Long: bisectLong,

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

var branchLong = `List, create, or delete branches`
var branchLong = `list, create, or delete branches`

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

Expand All @@ -25,7 +25,7 @@ var BranchCmd = &cobra.Command{

Use: "branch",

Short: "List, create, or delete branches",
Short: "list, create, or delete branches",

Long: branchLong,

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

var checkoutLong = `Switch branches or restore working tree files`
var checkoutLong = `switch branches or restore working tree files`

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

Expand All @@ -25,7 +25,7 @@ var CheckoutCmd = &cobra.Command{

Use: "checkout",

Short: "Switch branches or restore working tree files",
Short: "switch branches or restore working tree files",

Long: checkoutLong,

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

var cloneLong = `Clone a workspace or repository into a new directory`
var cloneLong = `clone a workspace or repository into a new directory`

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

Expand All @@ -25,7 +25,7 @@ var CloneCmd = &cobra.Command{

Use: "clone",

Short: "Clone a workspace or repository into a new directory",
Short: "clone a workspace or repository into a new directory",

Long: cloneLong,

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

var cmdLong = `Run commands from the scripting layer`
var cmdLong = `run commands from the scripting layer and your _tool.cue files`

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

Expand All @@ -25,7 +25,7 @@ var CmdCmd = &cobra.Command{

Use: "cmd [flags] [cmd] [args]",

Short: "Run commands from the scripting layer",
Short: "run commands from the scripting layer and your _tool.cue files",

Long: cmdLong,

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

var commitLong = `Record changes to the repository`
var commitLong = `record changes to the repository`

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

Expand All @@ -25,7 +25,7 @@ var CommitCmd = &cobra.Command{

Use: "commit",

Short: "Record changes to the repository",
Short: "record changes to the repository",

Long: commitLong,

Expand Down
5 changes: 3 additions & 2 deletions .hof/shadow/Cli/cmd/hof/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var configLong = `Manage local configurations`
var configLong = `manage local configurations`

var ConfigCmd = &cobra.Command{

Use: "config",

Short: "Manage local configurations",
Short: "manage local configurations",

Long: configLong,

Expand Down Expand Up @@ -51,5 +51,6 @@ func init() {

ConfigCmd.AddCommand(cmdconfig.GetCmd)
ConfigCmd.AddCommand(cmdconfig.SetCmd)
ConfigCmd.AddCommand(cmdconfig.UseCmd)

}
73 changes: 73 additions & 0 deletions .hof/shadow/Cli/cmd/hof/cmd/config/use.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package cmdconfig

import (
"fmt"
"os"

"strings"

"github.com/spf13/cobra"

"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var useLong = `bring a config into the current`

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

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

return err
}

var UseCmd = &cobra.Command{

Use: "use [name]",

Short: "bring a config into the current",

Long: useLong,

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 = UseRun(args)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
},
}

func init() {

help := UseCmd.HelpFunc()
usage := UseCmd.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)
}
UseCmd.SetHelpFunc(thelp)
UseCmd.SetUsageFunc(tusage)

}
6 changes: 4 additions & 2 deletions .hof/shadow/Cli/cmd/hof/cmd/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var contextLong = `Get, set, and use contexts`
var contextLong = `get, set, and use contexts`

var ContextCmd = &cobra.Command{

Use: "context",

Short: "Get, set, and use contexts",
Short: "get, set, and use contexts",

Long: contextLong,

Expand Down Expand Up @@ -52,5 +52,7 @@ func init() {
ContextCmd.AddCommand(cmdcontext.GetCmd)
ContextCmd.AddCommand(cmdcontext.SetCmd)
ContextCmd.AddCommand(cmdcontext.UseCmd)
ContextCmd.AddCommand(cmdcontext.SourceCmd)
ContextCmd.AddCommand(cmdcontext.ClearCmd)

}
73 changes: 73 additions & 0 deletions .hof/shadow/Cli/cmd/hof/cmd/context/clear.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package cmdcontext

import (
"fmt"
"os"

"strings"

"github.com/spf13/cobra"

"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var clearLong = `clear your context and environment`

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

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

return err
}

var ClearCmd = &cobra.Command{

Use: "clear",

Short: "clear your context and environment",

Long: clearLong,

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 = ClearRun(args)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
},
}

func init() {

help := ClearCmd.HelpFunc()
usage := ClearCmd.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)
}
ClearCmd.SetHelpFunc(thelp)
ClearCmd.SetUsageFunc(tusage)

}
73 changes: 73 additions & 0 deletions .hof/shadow/Cli/cmd/hof/cmd/context/source.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package cmdcontext

import (
"fmt"
"os"

"strings"

"github.com/spf13/cobra"

"github.com/hofstadter-io/hof/cmd/hof/ga"
)

var sourceLong = `source a context into your environment`

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

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

return err
}

var SourceCmd = &cobra.Command{

Use: "source [name]",

Short: "source a context into your environment",

Long: sourceLong,

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 = SourceRun(args)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
},
}

func init() {

help := SourceCmd.HelpFunc()
usage := SourceCmd.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)
}
SourceCmd.SetHelpFunc(thelp)
SourceCmd.SetUsageFunc(tusage)

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

var diffLong = `Show the difference between workspace versions`
var diffLong = `show the difference between workspace versions`

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

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

Use: "diff",

Short: "Show the difference between workspace versions",
Short: "show the difference between workspace versions",

Long: diffLong,

Expand Down

0 comments on commit f0e914f

Please sign in to comment.