Project modules, also known as sub-projects, are a frequently requested feature. This is my proposal on how to implement them.
Proposal
The idea
Project modules are the exact same thing as projects, expect that they can be associated with a parent project. This association is marked by an @. For example, grind-beans@make-coffee is a module of the project make-coffee.
Creating a project module
The syntax is the same as for creating a "normal" project. The logic for creating the project remains unchanged - it will simply create a file called grind-beans@make-coffee.json internally.
timetrace create project grind-beans@make-coffee
Tracking time for a project module
The start logic remains unchanged as well.
timetrace start grind-beans@make-coffee
Filtering records for a module
Once #52 is implemented, the list records command has a --project flag for filtering projects. With project modules, the respective logic would have to take an @ into account and additionally filter by module.
timetrace list records --project grind-beans@make-coffee today
Implementation
As mentioned above, project modules are stored in the exact same way as projects. Our example module will be stored as grind-beans@make-coffee.json inside the projects directory.
To list all available modules of the project make-coffee, all "projects" - e.g. modules - suffixed with @make-coffee can be displayed.
Project modules, also known as sub-projects, are a frequently requested feature. This is my proposal on how to implement them.
Proposal
The idea
Project modules are the exact same thing as projects, expect that they can be associated with a parent project. This association is marked by an
@
. For example,grind-beans@make-coffee
is a module of the projectmake-coffee
.Creating a project module
The syntax is the same as for creating a "normal" project. The logic for creating the project remains unchanged - it will simply create a file called
grind-beans@make-coffee.json
internally.Tracking time for a project module
The
start
logic remains unchanged as well.Filtering records for a module
Once #52 is implemented, the
list records
command has a--project
flag for filtering projects. With project modules, the respective logic would have to take an@
into account and additionally filter by module.Implementation
As mentioned above, project modules are stored in the exact same way as projects. Our example module will be stored as
grind-beans@make-coffee.json
inside theprojects
directory.To list all available modules of the project
make-coffee
, all "projects" - e.g. modules - suffixed with@make-coffee
can be displayed.