Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Define expected commands #15

Open
mattstratton opened this issue Apr 12, 2017 · 4 comments
Open

Define expected commands #15

mattstratton opened this issue Apr 12, 2017 · 4 comments
Labels
Status: In Progress Type: Question Something we need to figure out/discuss.

Comments

@mattstratton
Copy link
Member

A lot of this is sorta stubbed out, but I think that it makes sense, in order to work through the UX, to add all the commands and basics in the cobra stuff.

Here's what I think the high level command are:

  • config Returns the current configuration
  • doctor Check that everything looks good
  • event Create or modify an event
  • program Create or modify a program
  • speaker Create or modify speakers
  • sponsor Create or modify sponsors
  • version Return the current version of the tool

The main commands (event, program, speaker, and sponsor) all have sub-commands of add and edit, for consistency.

Add and edit commands for event, program, and speaker will take in either city year as arguments, or prompt for them. The add and edit commands for sponsor will take in the sponsor name as an argument or prompt for it.

Edit event should prompt and say "what field do you want to modify" or something. And then act on it. so maybe something like:

>event edit chicago 2017
Do you want to [1] edit the value of a field, [2] add an organizer, or [3] add a sponsor?
>1
Fields you can edit are [1] Event Twitter, [2] Google Analytics Tracking ID, [3] start date, [4] end date ... 
>1
The current value of your event twitter is devopsdays. Would you like to change it? (Y/n)
>Y
What should the new value be?
>@ponyville
Great! The new value has been set. 
Don't forget to use git to add, commit, and push up the new branch for review

The good things? We can validate fields as they are entered. The bad? The list of fields could get REALLY LONG.

What's going to end up happening is going through all the if cases (edit an organizer vs add one, how do they add sponsor levels?, etc)

@mattstratton
Copy link
Member Author

I've gone through this a bit more, and thought a bit about it, and according to how cobra approaches it:

The pattern to follow is APPNAME VERB NOUN –ADJECTIVE. or APPNAME COMMAND ARG –FLAG

With that, the high level commands are:

  • config Returns the current configuration
  • doctor Check that everything looks good
  • version Return the current version
  • add Add an event, sponsor, speaker, talk, program, etc
  • edit Edit an event, sponsor, speaker, talk, program, etc

so you could have something like this for a new event:

devopsdays-cli add event --city chicago --year 2017

and then the more fun one...

$ devopsdays-cli edit event --city chicago --year 2017
Do you want to [1] edit the value of a field, [2] add an organizer, or [3] add a sponsor?
> 1
Which field would you like to modify?

[1] Twitter
[2] Google Analytics Tracking ID
[3] Start Date
[4] End Date
[5] CFP Start Date
[6] CFP End Date
[7] CFP Announcement Date
[8] CFP Link
[9] Registation Start Date
[10] Registration End Date
[11] Registration Link
[12] Coordinates
[13] Location
[14] Location Address 
> 1
The value of this field is:  mattstratton
Would you like to change it [y/N]?
> y
What would you like to change it to?
> devopsdays
Value for Twitter has been changed to "devopsdays"
Would you like to [1] change another value, [2] go back to the main menu, or [3] quit the application?

@mattstratton
Copy link
Member Author

OK, after further analysis, I've gone back to the original high-level command idea.

The high-level commands are:

  • config Returns the current configuration
  • doctor Checks that everything looks good
  • event Create or edit an event
  • program Create or edit a program
  • speaker Create, edit, or remove a speaker
  • sponsor Add or remove a sponsor from an event; create or edit an existing sponsor
  • talk Create, edit, or remove a talk
  • version Returns version of tools, etc

So to go back to the previous example...to create a new event:

devopsdays-cli event create --city Chicago --year 2017

@mattstratton
Copy link
Member Author

mattstratton commented Sep 30, 2017

Gah. This is driving me crazy. I don't remember why I changed away from the initial one.

Remember, the pattern to follow is APPNAME VERB NOUN --ADJECTIVE. or APPNAME COMMAND ARG --FLAG.

That would mean it should be
devopsdays-cli create event --city chicago --year 2017

The verbs are:

  • add Add a thing to another thing add sponsor --city chicago --year 2017
  • create Make a new thing: create event --city chicago --year 2017
  • edit Change an existing thing. edit talk
  • remove Delete a thing. remove speaker george-bluth --city ponyville --year 2017
  • show Display a thing. show version, show config. Maybe it can also be used to show events, speakers, etc, but not worried about that right now.

The nouns are:

  • config
  • event
  • organizer
  • program
  • speaker
  • sponsor
  • talk
  • version

Not all verbs work with all nouns; for example, config only works with show, and remove won't work with sponsor.

@mattstratton
Copy link
Member Author

Here's the matrix of verbs and nouns:

config event organizer program speaker sponsor talk version
add x x x
create x x x x x x
edit x x x x x x
remove x x x x
show x x x x x x x x

@mattstratton mattstratton added this to the 1.0 Release milestone Oct 5, 2017
@mattstratton mattstratton removed this from the 1.0 Release milestone Oct 21, 2017
@stale stale bot added the wontfix Issues that are not needed to get fixed. label Dec 20, 2017
@stale stale bot closed this as completed Dec 27, 2017
@ghost ghost removed the in progress label Dec 27, 2017
@mattstratton mattstratton removed the wontfix Issues that are not needed to get fixed. label Mar 22, 2018
@mattstratton mattstratton reopened this Mar 22, 2018
@mattstratton mattstratton added this to the Sprint 1 milestone Mar 22, 2018
@stale stale bot added the wontfix Issues that are not needed to get fixed. label May 21, 2018
@mattstratton mattstratton removed the wontfix Issues that are not needed to get fixed. label May 25, 2018
@stale stale bot added the wontfix Issues that are not needed to get fixed. label Jul 24, 2018
@mattstratton mattstratton removed wontfix Issues that are not needed to get fixed. labels Nov 6, 2018
@stale stale bot added the wontfix Issues that are not needed to get fixed. label Jan 6, 2019
@mattstratton mattstratton removed the wontfix Issues that are not needed to get fixed. label Nov 1, 2019
@mattstratton mattstratton removed this from the Sprint 1 milestone Nov 1, 2019
@mattstratton mattstratton pinned this issue Nov 1, 2019
@devopsdays devopsdays deleted a comment from stale bot Nov 1, 2019
@devopsdays devopsdays deleted a comment from stale bot Nov 1, 2019
@devopsdays devopsdays deleted a comment from stale bot Nov 1, 2019
@devopsdays devopsdays deleted a comment from stale bot Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: In Progress Type: Question Something we need to figure out/discuss.
Projects
None yet
Development

No branches or pull requests

1 participant