-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
106 changed files
with
1,063 additions
and
455 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
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 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) | ||
|
||
} |
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 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) | ||
|
||
} |
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 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) | ||
|
||
} |
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
Oops, something went wrong.