Coder Social home page Coder Social logo

supd's People

Watchers

 avatar  avatar

supd's Issues

Requirements for v1 release

The following is a list of minimum requirements for a v1 release.

App

  • uses the $HOME/updates.json file for updates
  • set
    • set plan <string> sets the plan for today
      • --force/-f flag to overwrite plan
  • add
    • add done <string> adds to done list
  • view
    • view update shows the update for today (yesterday's done list + today's plan)
      • --last <number> shows last number updates
      • --since <date> shows updates since date
    • view plan shows today's plan
    • view done shows today's completed tasks
  • edit command opens the updates file for manual editing
  • refactor using cobra

Other

  • releases are automatic using GitHub actions after bumping the VERSION file
    • binaries are included in the assets and are built for every possible combination of GOOS and GOARCH values
  • the draft usage guide in the README is removed and remaining non-implemented features are converted to issues

use command context to simplify I/O

Cobra supports setting a context on a command. This should be leveraged to simplify I/O with the supd file, such as by parsing the file into the context at the root level and just accessing it within commands. If the details ofloading, parsing, and flushing changes can happen at the root level, that would be a great abstraction for the individual commands.

rethinking the command API

One issue I have with the current API is the ambiguity when providing flags. Take the plan command for example. There are three things I can do with a plan:

  1. Set the plan for the day (optional --force flag to overwrite)
  2. View the plan for the day with the --view flag
  3. Delete the plan for the day with the --delete flag

What happens if I ran this?

supd plan "This is a plan" --view --delete

It is not obvious what would happen, and there is choice left to the implementation that the user would just discover after they ran this.

What about a different API, following the pattern from the Cobra docs:

The pattern to follow is APPNAME VERB NOUN --ADJECTIVE.

Then we should have the following commands:

  • Set the plan for today: supd set plan <string> [--force]
  • View the plan for today: supd view plan
  • Delete the plan for today: supd delete plan

This is clear. It is impossible to write an ambiguous command this way. It also opens up the possibility for extending functionality with new adjectives, such as for viewing the plan on a different day.

supd view plan --date 2020-02-29

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.