Skip to content

Commit

Permalink
most of cmds working, more data loading working
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Aug 20, 2023
1 parent a7d02d6 commit 725e153
Show file tree
Hide file tree
Showing 37 changed files with 596 additions and 274 deletions.
8 changes: 5 additions & 3 deletions .hof/shadow/cli/cmd/hof/cmd/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ func init() {
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Comments), "comments", "C", false, "include comments in output")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.All), "all", "a", false, "show optional and hidden fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Concrete), "concrete", "c", false, "require the evaluation to be concrete")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Attributes), "attributes", "A", false, "diplay field attributes")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Hidden), "hidden", "H", false, "diplay hidden fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Optional), "optional", "O", false, "diplay optional fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Attributes), "attributes", "A", false, "display field attributes")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Definitions), "definitions", "S", true, "display defintions")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Hidden), "hidden", "H", false, "display hidden fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Optional), "optional", "O", false, "display optional fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Final), "final", "F", false, "finalize the value")
}

func EvalRun(args []string) (err error) {
Expand Down
1 change: 0 additions & 1 deletion .hof/shadow/cli/cmd/hof/cmd/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ var genLong = `hof unifies CUE with Go's text/template system and diff3

func init() {

GenCmd.Flags().BoolVarP(&(flags.GenFlags.Stats), "stats", "s", false, "print generator statistics")
GenCmd.Flags().StringSliceVarP(&(flags.GenFlags.Generator), "generator", "G", nil, "generator tags to run, default is all, or none if -T is used")
GenCmd.Flags().StringSliceVarP(&(flags.GenFlags.Template), "template", "T", nil, "template mapping to render, see help for format")
GenCmd.Flags().StringSliceVarP(&(flags.GenFlags.Partial), "partial", "P", nil, "file globs to partial templates to register with the templates")
Expand Down
1 change: 1 addition & 0 deletions .hof/shadow/cli/cmd/hof/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func init() {
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.InjectEnv), "inject-env", "V", false, "inject all ENV VARs as default tag vars")
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.AllErrors), "all-errors", "E", false, "print all available errors")
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.IngoreErrors), "ignore-errors", "i", false, "turn off output and assume defaults at prompts")
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.Stats), "stats", "s", false, "print generator statistics")
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.Quiet), "quiet", "q", false, "turn off output and assume defaults at prompts")
RootCmd.PersistentFlags().IntVarP(&(flags.RootPflags.Verbosity), "verbosity", "v", 0, "set the verbosity of output")
}
Expand Down
5 changes: 5 additions & 0 deletions .hof/shadow/cli/cmd/hof/cmd/vet.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ func init() {
VetCmd.Flags().StringVarP(&(flags.VetFlags.Out), "out", "", "", "output data format, when detection does not work")
VetCmd.Flags().StringVarP(&(flags.VetFlags.Outfile), "outfile", "o", "", "filename or - for stdout with optional file prefix")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Concrete), "concrete", "c", false, "require the evaluation to be concrete")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Comments), "comments", "C", false, "include comments in output")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Attributes), "attributes", "A", false, "display field attributes")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Definitions), "definitions", "S", true, "display defintions")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Hidden), "hidden", "H", false, "display hidden fields")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Optional), "optional", "O", false, "display optional fields")
}

func VetRun(args []string) (err error) {
Expand Down
2 changes: 2 additions & 0 deletions .hof/shadow/cli/cmd/hof/flags/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ type EvalFlagpole struct {
All bool
Concrete bool
Attributes bool
Definitions bool
Hidden bool
Optional bool
Final bool
}

var EvalFlags EvalFlagpole
1 change: 0 additions & 1 deletion .hof/shadow/cli/cmd/hof/flags/gen.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package flags

type GenFlagpole struct {
Stats bool
Generator []string
Template []string
Partial []string
Expand Down
1 change: 1 addition & 0 deletions .hof/shadow/cli/cmd/hof/flags/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type RootPflagpole struct {
InjectEnv bool
AllErrors bool
IngoreErrors bool
Stats bool
Quiet bool
Verbosity int
}
Expand Down
15 changes: 10 additions & 5 deletions .hof/shadow/cli/cmd/hof/flags/vet.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package flags

type VetFlagpole struct {
Expression []string
List bool
Out string
Outfile string
Concrete bool
Expression []string
List bool
Out string
Outfile string
Concrete bool
Comments bool
Attributes bool
Definitions bool
Hidden bool
Optional bool
}

var VetFlags VetFlagpole
8 changes: 5 additions & 3 deletions cmd/hof/cmd/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ func init() {
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Comments), "comments", "C", false, "include comments in output")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.All), "all", "a", false, "show optional and hidden fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Concrete), "concrete", "c", false, "require the evaluation to be concrete")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Attributes), "attributes", "A", false, "diplay field attributes")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Hidden), "hidden", "H", false, "diplay hidden fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Optional), "optional", "O", false, "diplay optional fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Attributes), "attributes", "A", false, "display field attributes")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Definitions), "definitions", "S", true, "display defintions")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Hidden), "hidden", "H", false, "display hidden fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Optional), "optional", "O", false, "display optional fields")
EvalCmd.Flags().BoolVarP(&(flags.EvalFlags.Final), "final", "F", false, "finalize the value")
}

func EvalRun(args []string) (err error) {
Expand Down
1 change: 0 additions & 1 deletion cmd/hof/cmd/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ var genLong = `hof unifies CUE with Go's text/template system and diff3

func init() {

GenCmd.Flags().BoolVarP(&(flags.GenFlags.Stats), "stats", "s", false, "print generator statistics")
GenCmd.Flags().StringSliceVarP(&(flags.GenFlags.Generator), "generator", "G", nil, "generator tags to run, default is all, or none if -T is used")
GenCmd.Flags().StringArrayVarP(&(flags.GenFlags.Template), "template", "T", nil, "template mapping to render, see help for format")
GenCmd.Flags().StringSliceVarP(&(flags.GenFlags.Partial), "partial", "P", nil, "file globs to partial templates to register with the templates")
Expand Down
1 change: 1 addition & 0 deletions cmd/hof/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func init() {
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.InjectEnv), "inject-env", "V", false, "inject all ENV VARs as default tag vars")
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.AllErrors), "all-errors", "E", false, "print all available errors")
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.IngoreErrors), "ignore-errors", "i", false, "turn off output and assume defaults at prompts")
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.Stats), "stats", "s", false, "print generator statistics")
RootCmd.PersistentFlags().BoolVarP(&(flags.RootPflags.Quiet), "quiet", "q", false, "turn off output and assume defaults at prompts")
RootCmd.PersistentFlags().IntVarP(&(flags.RootPflags.Verbosity), "verbosity", "v", 0, "set the verbosity of output")
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/hof/cmd/vet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ func init() {
VetCmd.Flags().StringVarP(&(flags.VetFlags.Out), "out", "", "", "output data format, when detection does not work")
VetCmd.Flags().StringVarP(&(flags.VetFlags.Outfile), "outfile", "o", "", "filename or - for stdout with optional file prefix")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Concrete), "concrete", "c", false, "require the evaluation to be concrete")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Comments), "comments", "C", false, "include comments in output")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Attributes), "attributes", "A", false, "display field attributes")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Definitions), "definitions", "S", true, "display defintions")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Hidden), "hidden", "H", false, "display hidden fields")
VetCmd.Flags().BoolVarP(&(flags.VetFlags.Optional), "optional", "O", false, "display optional fields")
}

func VetRun(args []string) (err error) {
Expand Down
2 changes: 2 additions & 0 deletions cmd/hof/flags/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ type EvalFlagpole struct {
All bool
Concrete bool
Attributes bool
Definitions bool
Hidden bool
Optional bool
Final bool
}

var EvalFlags EvalFlagpole
1 change: 0 additions & 1 deletion cmd/hof/flags/gen.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package flags

type GenFlagpole struct {
Stats bool
Generator []string
Template []string
Partial []string
Expand Down
1 change: 1 addition & 0 deletions cmd/hof/flags/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type RootPflagpole struct {
InjectEnv bool
AllErrors bool
IngoreErrors bool
Stats bool
Quiet bool
Verbosity int
}
Expand Down
15 changes: 10 additions & 5 deletions cmd/hof/flags/vet.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package flags

type VetFlagpole struct {
Expression []string
List bool
Out string
Outfile string
Concrete bool
Expression []string
List bool
Out string
Outfile string
Concrete bool
Comments bool
Attributes bool
Definitions bool
Hidden bool
Optional bool
}

var VetFlags VetFlagpole
55 changes: 52 additions & 3 deletions design/cmds/cue.cue
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,35 @@ EvalCommand: schema.Command & {
Short: "A"
Type: "bool"
Default: "false"
Help: "diplay field attributes"
Help: "display field attributes"
}, {
Name: "definitions"
Long: "definitions"
Short: "S"
Type: "bool"
Default: "true"
Help: "display defintions"
}, {
Name: "hidden"
Long: "hidden"
Short: "H"
Type: "bool"
Default: "false"
Help: "diplay hidden fields"
Help: "display hidden fields"
}, {
Name: "optional"
Long: "optional"
Short: "O"
Type: "bool"
Default: "false"
Help: "diplay optional fields"
Help: "display optional fields"
}, {
Name: "final"
Long: "final"
Short: "F"
Type: "bool"
Default: "false"
Help: "finalize the value"
}]
}

Expand Down Expand Up @@ -163,5 +177,40 @@ VetCommand: schema.Command & {
Type: "bool"
Default: "false"
Help: "require the evaluation to be concrete"
}, {
Name: "comments"
Long: "comments"
Short: "C"
Type: "bool"
Default: "false"
Help: "include comments in output"
}, {
Name: "attributes"
Long: "attributes"
Short: "A"
Type: "bool"
Default: "false"
Help: "display field attributes"
}, {
Name: "definitions"
Long: "definitions"
Short: "S"
Type: "bool"
Default: "true"
Help: "display defintions"
}, {
Name: "hidden"
Long: "hidden"
Short: "H"
Type: "bool"
Default: "false"
Help: "display hidden fields"
}, {
Name: "optional"
Long: "optional"
Short: "O"
Type: "bool"
Default: "false"
Help: "display optional fields"
}]
}
Loading

0 comments on commit 725e153

Please sign in to comment.