diff --git a/CHANGELOG.md b/CHANGELOG.md index c59efc094..c8370c1fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ * Allow specifying edge config file when using ziti-fabric-test loop2 * Add grouping data to streaming metrics, so values can be associated with their source metric * New WSS underlay to support Edge Router connections from Browser-based webapps using the ziti-sdk-js + * [ziti#151 enroll subcommand w/out args should print help](https://github.com/openziti/ziti/issues/192) + * Fix processing of `--configTypes all` in `ziti edge list services` # Release 0.16.2 diff --git a/common/enrollment/enroll.go b/common/enrollment/enroll.go index ef457c741..95bea1a68 100644 --- a/common/enrollment/enroll.go +++ b/common/enrollment/enroll.go @@ -45,7 +45,7 @@ const outFlag = "out" func NewEnrollCommand() *cobra.Command { var enrollSubCmd = &cobra.Command{ SilenceErrors: true, - SilenceUsage: true, + SilenceUsage: false, Use: "enroll", Short: "enroll an identity", PersistentPreRun: func(cmd *cobra.Command, args []string) { @@ -83,7 +83,9 @@ func NewEnrollCommand() *cobra.Command { enrollSubCmd.Flags().StringVarP(&keyPath, "key", "k", "", keyDesc) - _ = enrollSubCmd.MarkFlagRequired("jwt") + if err := enrollSubCmd.MarkFlagRequired("jwt"); err != nil { + panic(err) + } return enrollSubCmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/list.go b/ziti/cmd/ziti/cmd/edge_controller/list.go index 5612c40e6..182dc4bba 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/list.go +++ b/ziti/cmd/ziti/cmd/edge_controller/list.go @@ -480,11 +480,15 @@ func runListServices(asIdentity string, configTypes []string, roleFilters []stri params.Add("asIdentity", asIdentity) } - if configTypes, err := mapNamesToIDs("config-types", configTypes...); err != nil { - return err + if len(configTypes) == 1 && strings.EqualFold("all", configTypes[0]) { + params.Add("configTypes", "all") } else { - for _, configType := range configTypes { - params.Add("configTypes", configType) + if configTypes, err := mapNamesToIDs("config-types", configTypes...); err != nil { + return err + } else { + for _, configType := range configTypes { + params.Add("configTypes", configType) + } } } for _, roleFilter := range roleFilters { @@ -512,7 +516,7 @@ func outputServices(o *commonOptions, children []*gabs.Container, pagingInfo *pa terminatorStrategy, _ := entity.Path("terminatorStrategy").Data().(string) roleAttributes := entity.Path("roleAttributes").String() - _, err := fmt.Fprintf(o.Out, "id: %v name: %v encryption required: %v terminator strategy: %v role attributes: %v\n", id, name, encryptionRequired , terminatorStrategy, roleAttributes) + _, err := fmt.Fprintf(o.Out, "id: %v name: %v encryption required: %v terminator strategy: %v role attributes: %v\n", id, name, encryptionRequired, terminatorStrategy, roleAttributes) if err != nil { return err }