@@ -13,23 +13,25 @@ func init() {
1313 usage := `
1414Examples:
1515
16- Add a key-value pair to a repository:
16+ Add a key-value pair metadata to a repository:
1717
18- $ src repos add-kvp -repo=repoID -key=mykey -value=myvalue
18+ $ src repos add-metadata -repo=repoID -key=mykey -value=myvalue
1919
2020 Omitting -value will create a tag (a key with a null value).
21+
22+ [DEPRECATED] Note that 'add-kvp' is deprecated and will be removed in future release. Use 'add-metadata' instead.
2123`
2224
23- flagSet := flag .NewFlagSet ("add-kvp " , flag .ExitOnError )
25+ flagSet := flag .NewFlagSet ("add-metadata " , flag .ExitOnError )
2426 usageFunc := func () {
2527 fmt .Fprintf (flag .CommandLine .Output (), "Usage of 'src repos %s':\n " , flagSet .Name ())
2628 flagSet .PrintDefaults ()
2729 fmt .Println (usage )
2830 }
2931 var (
30- repoFlag = flagSet .String ("repo" , "" , `The ID of the repo to add the key-value pair to (required)` )
31- keyFlag = flagSet .String ("key" , "" , `The name of the key to add (required)` )
32- valueFlag = flagSet .String ("value" , "" , `The value associated with the key. Defaults to null.` )
32+ repoFlag = flagSet .String ("repo" , "" , `The ID of the repo to add the key-value pair metadata to (required)` )
33+ keyFlag = flagSet .String ("key" , "" , `The name of the metadata key to add (required)` )
34+ valueFlag = flagSet .String ("value" , "" , `The metadata value associated with the metadata key. Defaults to null.` )
3335 apiFlags = api .NewFlags (flagSet )
3436 )
3537
@@ -60,7 +62,7 @@ Examples:
6062
6163 client := cfg .apiClient (apiFlags , flagSet .Output ())
6264
63- query := `mutation addKVP (
65+ query := `mutation addRepoMetadata (
6466 $repo: ID!,
6567 $key: String!,
6668 $value: String,
@@ -83,16 +85,17 @@ Examples:
8385 }
8486
8587 if valueFlag != nil {
86- fmt .Printf ("Key-value pair '%s:%v' created.\n " , * keyFlag , * valueFlag )
88+ fmt .Printf ("Key-value pair metadata '%s:%v' created.\n " , * keyFlag , * valueFlag )
8789 } else {
88- fmt .Printf ("Key-value pair '%s:<nil>' created.\n " , * keyFlag )
90+ fmt .Printf ("Key-value pair metadata '%s:<nil>' created.\n " , * keyFlag )
8991 }
9092 return nil
9193 }
9294
9395 // Register the command.
9496 reposCommands = append (reposCommands , & command {
9597 flagSet : flagSet ,
98+ aliases : []string {"add-kvp" },
9699 handler : handler ,
97100 usageFunc : usageFunc ,
98101 })
0 commit comments