Skip to content

Commit

Permalink
hook up jump command, add some i/o flags
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed May 25, 2020
1 parent 281881e commit 81a815b
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 2 deletions.
1 change: 1 addition & 0 deletions .hof/shadow/Cli/cmd/hof/cmd/labelset.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var LabelsetCmd = &cobra.Command{
Use: "labelset",

Aliases: []string{
"L",
"lset",
},

Expand Down
6 changes: 6 additions & 0 deletions .hof/shadow/Cli/cmd/hof/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ func init() {
RootCmd.PersistentFlags().StringVarP(&flags.RootContextPflag, "context", "", "", "The of an entry in the context file")
RootCmd.PersistentFlags().BoolVarP(&flags.RootGlobalPflag, "global", "", false, "Operate using only the global config/secret context")
RootCmd.PersistentFlags().BoolVarP(&flags.RootLocalPflag, "local", "", false, "Operate using only the local config/secret context")
RootCmd.PersistentFlags().StringSliceVarP(&flags.RootInputPflag, "input", "i", nil, "input streams, depending on the command context")
RootCmd.PersistentFlags().StringVarP(&flags.RootInputFormatPflag, "input-format", "I", "", "input format, defaults to infered")
RootCmd.PersistentFlags().StringSliceVarP(&flags.RootOutputPflag, "output", "o", nil, "output streams, depending on the command context")
RootCmd.PersistentFlags().StringVarP(&flags.RootOutputFormatPflag, "output-format", "O", "", "output format, defaults to cue")
RootCmd.PersistentFlags().StringSliceVarP(&flags.RootErrorPflag, "error", "", nil, "error streams, depending on the command context")
RootCmd.PersistentFlags().StringVarP(&flags.RootErrorFormatPflag, "error-format", "", "", "error format, defaults to cue")
RootCmd.PersistentFlags().StringVarP(&flags.RootAccountPflag, "account", "", "", "the account context to use during this hof execution")
RootCmd.PersistentFlags().StringVarP(&flags.RootBillingPflag, "billing", "", "", "the billing context to use during this hof execution")
RootCmd.PersistentFlags().StringVarP(&flags.RootProjectPflag, "project", "", "", "the project context to use during this hof execution")
Expand Down
6 changes: 6 additions & 0 deletions .hof/shadow/Cli/cmd/hof/flags/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ var (
RootContextPflag string
RootGlobalPflag bool
RootLocalPflag bool
RootInputPflag []string
RootInputFormatPflag string
RootOutputPflag []string
RootOutputFormatPflag string
RootErrorPflag []string
RootErrorFormatPflag string
RootAccountPflag string
RootBillingPflag string
RootProjectPflag string
Expand Down
6 changes: 5 additions & 1 deletion cmd/hof/cmd/jump.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ import (
"github.com/spf13/cobra"

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

"github.com/hofstadter-io/hof/lib/ops"
)

var jumpLong = `Jumps help you do things with fewer keystrokes.`

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

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

err = ops.RunJumpFromArgs(args)

return err
}
Expand Down
1 change: 1 addition & 0 deletions cmd/hof/cmd/labelset.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var LabelsetCmd = &cobra.Command{
Use: "labelset",

Aliases: []string{
"L",
"lset",
},

Expand Down
6 changes: 6 additions & 0 deletions cmd/hof/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ func init() {
RootCmd.PersistentFlags().StringVarP(&flags.RootContextPflag, "context", "", "", "The of an entry in the context file")
RootCmd.PersistentFlags().BoolVarP(&flags.RootGlobalPflag, "global", "", false, "Operate using only the global config/secret context")
RootCmd.PersistentFlags().BoolVarP(&flags.RootLocalPflag, "local", "", false, "Operate using only the local config/secret context")
RootCmd.PersistentFlags().StringSliceVarP(&flags.RootInputPflag, "input", "i", nil, "input streams, depending on the command context")
RootCmd.PersistentFlags().StringVarP(&flags.RootInputFormatPflag, "input-format", "I", "", "input format, defaults to infered")
RootCmd.PersistentFlags().StringSliceVarP(&flags.RootOutputPflag, "output", "o", nil, "output streams, depending on the command context")
RootCmd.PersistentFlags().StringVarP(&flags.RootOutputFormatPflag, "output-format", "O", "", "output format, defaults to cue")
RootCmd.PersistentFlags().StringSliceVarP(&flags.RootErrorPflag, "error", "", nil, "error streams, depending on the command context")
RootCmd.PersistentFlags().StringVarP(&flags.RootErrorFormatPflag, "error-format", "", "", "error format, defaults to cue")
RootCmd.PersistentFlags().StringVarP(&flags.RootAccountPflag, "account", "", "", "the account context to use during this hof execution")
RootCmd.PersistentFlags().StringVarP(&flags.RootBillingPflag, "billing", "", "", "the billing context to use during this hof execution")
RootCmd.PersistentFlags().StringVarP(&flags.RootProjectPflag, "project", "", "", "the project context to use during this hof execution")
Expand Down
6 changes: 6 additions & 0 deletions cmd/hof/flags/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ var (
RootContextPflag string
RootGlobalPflag bool
RootLocalPflag bool
RootInputPflag []string
RootInputFormatPflag string
RootOutputPflag []string
RootOutputFormatPflag string
RootErrorPflag []string
RootErrorFormatPflag string
RootAccountPflag string
RootBillingPflag string
RootProjectPflag string
Expand Down
2 changes: 1 addition & 1 deletion design/cli/cmds/label.cue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import (
TBD: "α"
Name: "labelset"
Usage: "labelset"
Aliases: ["lset"]
Aliases: ["L", "lset"]
Short: "group resources, datamodels, labelsets, and more"
Long: Short

Expand Down
52 changes: 52 additions & 0 deletions design/cli/pflags.cue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,58 @@ import (
Help: "Operate using only the local config/secret context"
},

// i/o formats and streams
{
Name: "input"
Long: "input"
Short: "i"
Type: "[]string"
Default: "nil"
Help: "input streams, depending on the command context"
},
{
Name: "inputFormat"
Long: "input-format"
Short: "I"
Type: "string"
Default: ""
Help: "input format, defaults to infered"
},

{
Name: "output"
Long: "output"
Short: "o"
Type: "[]string"
Default: "nil"
Help: "output streams, depending on the command context"
},
{
Name: "outputFormat"
Long: "output-format"
Short: "O"
Type: "string"
Default: ""
Help: "output format, defaults to cue"
},

{
Name: "error"
Long: "error"
Short: ""
Type: "[]string"
Default: "nil"
Help: "error streams, depending on the command context"
},
{
Name: "errorFormat"
Long: "error-format"
Short: ""
Type: "string"
Default: ""
Help: "error format, defaults to cue"
},

// context should encapsulate the next three
{
Name: "account"
Expand Down

0 comments on commit 81a815b

Please sign in to comment.