Skip to content

Define expected commands #15

Open
Open

Description

@mattstratton

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)

Activity

  1. mattstratton commented on Sep 28, 2017

    @mattstratton
    MemberAuthor

    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?
    
  2. mattstratton commented on Sep 29, 2017

    @mattstratton
    MemberAuthor

    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

  3. mattstratton commented on Sep 30, 2017

    @mattstratton
    MemberAuthor

    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.

  4. mattstratton commented on Oct 2, 2017

    @mattstratton
    MemberAuthor

    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
  5. added this to the 1.0 Release milestone on Oct 5, 2017
  6. removed this from the 1.0 Release milestone on Oct 21, 2017
  7. added
    wontfix
    on Dec 20, 2017
  8. removed
    wontfix
    on Mar 22, 2018
  9. 9 remaining items

  10. removed
    wontfix
    on May 25, 2018
  11. added
    wontfix
    on Jul 24, 2018
  12. removed
    wontfix
    on Nov 6, 2018
  13. added
    wontfix
    on Jan 6, 2019
  14. removed
    wontfix
    on Nov 1, 2019
  15. removed this from the milestone on Nov 1, 2019
  16. pinned this issue on Nov 1, 2019
  17. deleted a comment from stale on Nov 1, 2019
  18. deleted a comment from stale on Nov 1, 2019
  19. deleted a comment from stale on Nov 1, 2019
  20. deleted a comment from stale on Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: In ProgressType: Question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions