@@ -11,10 +11,12 @@ import (
1111var addSpeakerCmd = & cobra.Command {
1212 Use : "speaker" ,
1313 Short : "Add a speaker to an existing talk" ,
14- Long : `Add a speaker to an existing talk
15-
16- You can provide the speaker's name as an argument to this command, but it must be in quotes. For example:
17- devopsdays-cli create speaker "George Bluth"` ,
14+ Long : `Add a speaker to an existing talk.
15+ You can provide the speaker's name as an argument to this command, but it must be the "cleaned" name.
16+ ` ,
17+ Example : ` devopsdays-cli add speaker george-bluth
18+ devopsdays-cli add speaker --city new-york
19+ devopsdays-cli add speaker george-bluth -c "New York" --year "2017"` ,
1820 Args : cobra .MaximumNArgs (1 ),
1921 Run : func (cmd * cobra.Command , args []string ) {
2022 // TODO: Work your own magic here
@@ -26,10 +28,13 @@ You can provide the speaker's name as an argument to this command, but it must b
2628var createSpeakerCmd = & cobra.Command {
2729 Use : "speaker" ,
2830 Short : "Creates a new speaker for an event" ,
29- Long : `Creates a new speaker for an event
31+ Long : `Creates a new speaker for an event.
32+ You can provide the speaker's name as an argument to this command, but it must be the "cleaned" name.
33+ ` ,
34+ Example : ` devopsdays-cli create speaker george-bluth
35+ devopsdays-cli create speaker --city new-york
36+ devopsdays-cli create speaker george-bluth -c "New York" --year "2017"` ,
3037
31- You can provide the speaker's name as an argument to this command, but it must be in quotes. For example:
32- devopsdays-cli create speaker "George Bluth"` ,
3338 Args : cobra .MaximumNArgs (1 ),
3439 Run : func (cmd * cobra.Command , args []string ) {
3540 if len (args ) > 0 {
@@ -44,11 +49,12 @@ devopsdays-cli create speaker "George Bluth"`,
4449var editSpeakerCmd = & cobra.Command {
4550 Use : "speaker" ,
4651 Short : "Edit an event's speaker" ,
47- Long : `Edit an event's speaker
48-
49- You can provide the speaker's name as an argument to this command, but it must be the "cleaned" name. For example:
50-
51- devopsdays-cli edit speaker george-bluth` ,
52+ Long : `Edit an event's speaker.
53+ You can provide the speaker's name as an argument to this command, but it must be the "cleaned" name.
54+ ` ,
55+ Example : ` devopsdays-cli edit speaker george-bluth
56+ devopsdays-cli edit speaker --city new-york
57+ devopsdays-cli edit speaker george-bluth -c "New York" --year "2017"` ,
5258 Args : cobra .MaximumNArgs (1 ),
5359 Run : func (cmd * cobra.Command , args []string ) {
5460 if len (args ) > 0 {
@@ -63,10 +69,12 @@ You can provide the speaker's name as an argument to this command, but it must b
6369var removeSpeakerCmd = & cobra.Command {
6470 Use : "speaker" ,
6571 Short : "Remove a speaker from an event" ,
66- Long : `Remove a speaker from an event
67- You can provide the speaker's name as an argument to this command, but it must be the "cleaned" name. For example:
68-
69- devopsdays-cli remove speaker george-bluth` ,
72+ Long : `Remove a speaker from an event.
73+ You can provide the speaker's name as an argument to this command, but it must be the "cleaned" name.
74+ ` ,
75+ Example : ` devopsdays-cli remove speaker george-bluth
76+ devopsdays-cli remove speaker --city new-york
77+ devopsdays-cli remove speaker george-bluth -c "New York" --year "2017"` ,
7078 Args : cobra .MaximumNArgs (1 ),
7179 Run : func (cmd * cobra.Command , args []string ) {
7280 // TODO: Work your own magic here
@@ -78,10 +86,12 @@ You can provide the speaker's name as an argument to this command, but it must b
7886var showSpeakerCmd = & cobra.Command {
7987 Use : "speaker" ,
8088 Short : "Show a speaker from an event" ,
81- Long : `Show a speaker from an event
82- You can provide the speaker's name as an argument to this command, but it must be the "cleaned" name. For example:
83-
84- devopsdays-cli show speaker george-bluth` ,
89+ Long : `Show a speaker from an event.
90+ You can provide the speaker's name as an argument to this command, but it must be the "cleaned" name.
91+ ` ,
92+ Example : ` devopsdays-cli remove speaker george-bluth
93+ devopsdays-cli show speaker --city new-york --year 2017 --all
94+ devopsdays-cli remove speaker george-bluth -c "New York" --year "2017"` ,
8595 Args : cobra .MaximumNArgs (1 ),
8696 Run : func (cmd * cobra.Command , args []string ) {
8797 // TODO: Work your own magic here
@@ -96,15 +106,17 @@ func init() {
96106 removeCmd .AddCommand (removeSpeakerCmd )
97107 showCmd .AddCommand (showSpeakerCmd )
98108
99- // Here you will define your flags and configuration settings.
100-
101- // Cobra supports Persistent Flags which will work for this command
102- // and all subcommands, e.g.:
103- // speakerCmd.PersistentFlags().String("foo", "", "A help for foo")
104-
105- // Cobra supports local flags which will only run when this command
106- // is called directly, e.g.:
107- // speakerCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
109+ addSpeakerCmd .Flags ().StringVarP (& City , "city" , "c" , "" , "city to use" )
110+ addSpeakerCmd .Flags ().StringVarP (& Year , "year" , "y" , "" , "year to use" )
111+ createSpeakerCmd .Flags ().StringVarP (& City , "city" , "c" , "" , "city to use" )
112+ createSpeakerCmd .Flags ().StringVarP (& Year , "year" , "y" , "" , "year to use" )
113+ editSpeakerCmd .Flags ().StringVarP (& City , "city" , "c" , "" , "city to use" )
114+ editSpeakerCmd .Flags ().StringVarP (& Year , "year" , "y" , "" , "year to use" )
115+ removeSpeakerCmd .Flags ().StringVarP (& City , "city" , "c" , "" , "city to use" )
116+ removeSpeakerCmd .Flags ().StringVarP (& Year , "year" , "y" , "" , "year to use" )
117+ showSpeakerCmd .Flags ().StringVarP (& City , "city" , "c" , "" , "city to use" )
118+ showSpeakerCmd .Flags ().StringVarP (& Year , "year" , "y" , "" , "year to use" )
119+ showSpeakerCmd .Flags ().BoolVarP (& All , "all" , "a" , false , "show all" )
108120
109121}
110122
0 commit comments