xaizek / dit (License: GPLv3) (since 2018-12-07)
Command-line task keeper that remembers all old values and is meant to combine several orthogonal features to be rather flexible in managing items.
<root> / CODE.md (b9e6ddc52b4e3b9207e10f416ecce2c907798cb0) (1,595B) (mode 100644) [raw]
### Configuration defaults ###

#### For project ####

Using `Config::get(name, defaultValue)`.

#### For global configuration ####

Using parent configuration of global configuration filled with default values
during initialization of main application class.

### Object initialization ###

For performance reasons main classes like `Config`, `Project`, `Storage`, `Item`
all initialize themselves lazily (with help of `StorageBacked` class).  To
facilitate this each of them initializes crucial things in constructors, but
does actual load in private `load()` method and public API should call
`ensureLoaded()` if they rely on lazy-loadable data.

### Commands ###

#### Execution and completion ####

There are two virtual methods for each of the action: one for global operation
and one for project specific action.  First one gets application reference while
the second one gets project reference.  Invocation order is: global then project
specific.  One can do all the work at project specific level (if it makes sense)
by saving data passed into global handler for future use.

Completion is a first-class operation and is handled on many levels of code.

#### Registration ####

This is done automatically by `AutoRegisteredCommand` class.  Commands just need
to derive from it (CRTP is involved).

### Interaction with tests ###

Tests mostly use public API, but sometimes it's not enough, in which case
Passkey idiom is used to provide dedicated testing API.  Passkeys allow
accessing particular methods for `Tests` class, which provides a set of static
methods for use in test cases.
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/dit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/dit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master