Skip to content

Commit 4e4a5a4

Browse files
committed
be consistent with "route map" over "routemap"
1 parent 4f3095a commit 4e4a5a4

File tree

8 files changed

+19
-18
lines changed

8 files changed

+19
-18
lines changed

cmd/routemap/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func main() {
7474

7575
rootCmd.Use = filepath.Base(os.Args[0])
7676
rootCmd.Version = fmt.Sprintf("%s from %s (%s)", version, date, commit)
77-
rootCmd.Short = fmt.Sprintf("Manage Pulsar routemaps [%s]", rootCmd.Version)
77+
rootCmd.Short = fmt.Sprintf("Manage Pulsar Route Maps [%s]", rootCmd.Version)
7878

7979
rootCmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
8080
return multierr.Combine(
@@ -102,6 +102,7 @@ func main() {
102102

103103
pf.StringVar(&globals.CacheDir, "cachedir", globals.CacheDir,
104104
"Where to store cached data.")
105+
pf.MarkHidden("cachedir") // Not being used yet.
105106

106107
pf.StringVar(&globals.NS1APIBaseURL, "api-baseurl", globals.NS1APIBaseURL,
107108
"Base URL for NS1 REST API. Normally the default will suffice.")

internal/crud/cmd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ func (o *Options) validateMapID() error {
5353

5454
func (o *Options) addFileFlag(flags *pflag.FlagSet) {
5555
flags.StringVar(&o.InputFilename, "file", "",
56-
"Routemap file to validate. Default is STDIN.")
56+
"Route map file to validate. Default is STDIN.")
5757
}
5858

5959
func (o *Options) addNoValidateFlag(flags *pflag.FlagSet) {
6060
flags.BoolVar(&o.SkipValidate, "no-validate", false,
61-
"Validate the routemap before uploading.")
61+
"Validate the route map before uploading.")
6262
}
6363

6464
func (o *Options) addMapIDFlag(flags *pflag.FlagSet, desc string) {
@@ -69,7 +69,7 @@ func addCreateCommand(parentCmd *cobra.Command, globals *config.CommandLineGloba
6969
opts := &Options{Globals: globals}
7070
sub := &cobra.Command{
7171
Use: "create",
72-
Short: "Create a new routemap with optional validation",
72+
Short: "Create a new route map with optional validation",
7373
PreRunE: func(cmd *cobra.Command, args []string) error {
7474
return multierr.Combine(
7575
opts.Globals.RequireAPIAccess(),
@@ -97,7 +97,7 @@ func addListCommand(parentCmd *cobra.Command, globals *config.CommandLineGlobals
9797
sub := &cobra.Command{
9898
Use: "list",
9999
Aliases: []string{"ls"},
100-
Short: "List available routemaps",
100+
Short: "List available route maps",
101101
PreRunE: func(cmd *cobra.Command, args []string) error {
102102
return opts.Globals.RequireAPIAccess()
103103
},
@@ -117,7 +117,7 @@ func addReplaceCommand(parentCmd *cobra.Command, globals *config.CommandLineGlob
117117
opts := &Options{Globals: globals}
118118
sub := &cobra.Command{
119119
Use: "replace",
120-
Short: "Replace an existing routemap with optional validation",
120+
Short: "Replace an existing route map with optional validation",
121121
PreRunE: func(cmd *cobra.Command, args []string) error {
122122
return multierr.Combine(
123123
opts.Globals.RequireAPIAccess(),
@@ -142,7 +142,7 @@ func addDeleteCommand(parentCmd *cobra.Command, globals *config.CommandLineGloba
142142
opts := &Options{Globals: globals}
143143
sub := &cobra.Command{
144144
Use: "delete",
145-
Short: "Delete a routemap by ID",
145+
Short: "Delete a route map by ID",
146146
PreRunE: func(cmd *cobra.Command, args []string) error {
147147
return multierr.Combine(
148148
opts.Globals.RequireAPIAccess(),

internal/crud/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func RunDeleteCommand(opts *Options) error {
2525
if err := client.DeleteRoutemap(opts.MapID); err != nil {
2626
return err
2727
} else {
28-
lg.Printf("deleted routemap %d", opts.MapID)
28+
lg.Printf("deleted route map %d", opts.MapID)
2929
}
3030

3131
return nil

internal/crud/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func RunListCommand(opts *Options) error {
4141
func prettyPrint(body []byte) error {
4242
var rmaps []api.RoutemapPayload
4343
if err := json.Unmarshal(body, &rmaps); err != nil {
44-
return fmt.Errorf("parsing routemap payload: %v", err)
44+
return fmt.Errorf("parsing route map payload: %v", err)
4545
}
4646

4747
tw := tabwriter.NewWriter(os.Stdout, 8, 8, 1, ' ', 0)

internal/crud/upload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func RunCreateOrReplaceCommand(opts *Options) error {
4444
lg.Infof("map is valid; ready for upload")
4545
}
4646

47-
lg.Infof("uploading routemap: meta version = %d, sha1 = %s, size = %d",
47+
lg.Infof("uploading route map: meta version = %d, sha1 = %s, size = %d",
4848
root.MetaVersion(),
4949
hex.EncodeToString(root.SHA1),
5050
root.SizeInBytes)

internal/validate/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func AddCommands(parentCmd *cobra.Command, globals *config.CommandLineGlobals) {
2929
opts := &Options{Globals: globals}
3030
sub := &cobra.Command{
3131
Use: "validate",
32-
Short: "Load and validate a routemap file",
32+
Short: "Load and validate a route map file",
3333
RunE: func(cmd *cobra.Command, args []string) error {
3434
return RunValidateCommand(opts)
3535
},
@@ -38,7 +38,7 @@ func AddCommands(parentCmd *cobra.Command, globals *config.CommandLineGlobals) {
3838
flags := sub.Flags()
3939

4040
flags.StringVar(&opts.InputFilename, "file", "",
41-
"Routemap file to validate. Default is STDIN.")
41+
"Route map file to validate. Default is STDIN.")
4242

4343
parentCmd.AddCommand(sub)
4444
}

internal/validate/validator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
func RunValidateCommand(opts *Options) error {
29-
lg.Infof("reading routemap from '%s'", opts.InputFilename)
29+
lg.Infof("reading route map from '%s'", opts.InputFilename)
3030
root, summary, err := LoadAndValidate(opts.InputFilename)
3131
if err != nil {
3232
return PrettyPrintErrors(err)
@@ -176,7 +176,7 @@ func startValidate(root *model.RoutemapRoot, summary *model.RoutemapSummary) err
176176
}
177177

178178
if len(root.Routemap) == 0 {
179-
lg.Warnf("routemap is empty; skipping all validation")
179+
lg.Warnf("route map is empty; skipping all validation")
180180
summary.NumNetworks = 0
181181
return nil
182182
}

pkg/model/rmap.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type RoutemapRoot struct {
4444
Raw []byte `json:"-"`
4545
}
4646

47-
// LoadRoutemapFileOrStdin loads a routemap from the named file (if name is not empty)
47+
// LoadRoutemapFileOrStdin loads a route map from the named file (if name is not empty)
4848
// or falls back to STDIN.
4949
func LoadRoutemapFileOrStdin(optionalFilename string) (*RoutemapRoot, error) {
5050
if len(optionalFilename) == 0 {
@@ -54,7 +54,7 @@ func LoadRoutemapFileOrStdin(optionalFilename string) (*RoutemapRoot, error) {
5454
}
5555
}
5656

57-
// LoadRoutemapFilename loads a routemap from a filename.
57+
// LoadRoutemapFilename loads a route map from a filename.
5858
func LoadRoutemapFilename(filename string) (*RoutemapRoot, error) {
5959
if source, err := os.Open(filename); err == nil {
6060
defer source.Close()
@@ -64,7 +64,7 @@ func LoadRoutemapFilename(filename string) (*RoutemapRoot, error) {
6464
}
6565
}
6666

67-
// LoadRoutemapFile loads a routemap from an already-opened file.
67+
// LoadRoutemapFile loads a route map from an already-opened file.
6868
func LoadRoutemapFile(source *os.File) (*RoutemapRoot, error) {
6969
rmap := &RoutemapRoot{}
7070

@@ -83,7 +83,7 @@ func LoadRoutemapFile(source *os.File) (*RoutemapRoot, error) {
8383
if decErr := dec.Decode(rmap); decErr != nil {
8484
switch decErr.(type) {
8585
case *json.SyntaxError:
86-
return nil, fmt.Errorf("parsing routemap: %s at byte offset %d", decErr, decErr.(*json.SyntaxError).Offset)
86+
return nil, fmt.Errorf("parsing route map: %s at byte offset %d", decErr, decErr.(*json.SyntaxError).Offset)
8787
default:
8888
return nil, decErr
8989
}

0 commit comments

Comments
 (0)