Skip to content

Commit 90cd870

Browse files
committedDec 5, 2021
Updated CLI to subcommands
1 parent 253faab commit 90cd870

File tree

4 files changed

+184
-135
lines changed

4 files changed

+184
-135
lines changed
 

‎Cargo.lock

+53-54
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "genee"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
authors = ["Lőrinc Serfőző <lorinc.serfozo@mailbox.org>"]
55
edition = "2018"
66
default-run = "genee"

‎README.md

+26-24
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@ genee is a simple habit tracker program for the command line
1111

1212
## Workflow
1313

14-
1. Figure out the list of habits to track. In this example, we would like to restrict our gaming binges and increase the frequency of our piano exercise sessions.
14+
1. Figure out the list of habits to track. In this example, we would like to restrict
15+
our gaming binges and increase the frequency of our piano exercise sessions.
1516
`GAM` stands for gaming, whereas `PNO` stands for the instrumental practice.
1617
2. Download the [latest release](https://github.com/mfep/genee/releases/latest) from this repository.
17-
3. Using the downloaded executable, create a new data file to store the diary data. Specify the list of habit abbreviations to use in this file:
18-
```genee --new GAM,PNO```
19-
4. Each day, fill in whether you practiced the particular habits the previous day or not. This can be done by invoking
20-
```genee -f```. This is followed by a prompt for each habit.
21-
5. After the fill command, the program displays the habit data of the current period (e.g. the number of habit occurences in the last 30 days)
22-
compared to the last period (the number of habit occurences between 30 and 60 days before now). This can be used to check whether our change of habits
23-
(picking up new habits, dropping bad ones) are on track or not.
18+
3. Using the downloaded executable, create a new data file to store the diary data.
19+
Specify the list of habit abbreviations to use in this file: ```genee new GAM,PNO```
20+
4. Each day, fill in whether you practiced the particular habits the previous day or not.
21+
This can be done by invoking ```genee fill```. This is followed by a prompt for each habit.
22+
5. After the fill command, the program displays the habit data of the current period
23+
(e.g. the number of habit occurences in the last 30 days) compared to the last period
24+
(the number of habit occurences between 30 and 60 days before now).
25+
This can be used to check whether our change of habits (picking up new habits,
26+
dropping bad ones) are on track or not.
2427

2528
### Example output diagram
2629
![](https://user-images.githubusercontent.com/12499658/121962015-72212600-cd68-11eb-82fb-30279566b220.png)
@@ -32,23 +35,13 @@ genee X.Y.Z
3235
A habit tracker app with command-line interface
3336
3437
USAGE:
35-
genee.exe [FLAGS] [OPTIONS]
38+
genee [OPTIONS] <SUBCOMMAND>
3639
3740
FLAGS:
38-
-f, --fill If set, habit information for all the missing days is queried between --append-date and
39-
yesterday. If --append-date is not set, all the missing days are queried between the first
40-
entry in the diary and yesterday
41-
-h, --help Prints help information
42-
--list-config If set, the current persistent configuration is displayed to the terminal
43-
--save-config If set, the provided values for --datafile --graph-days --past-periods --max-displayed-cols and
44-
--list-previous-days options are written to the persistent configuration. Unspecified options
45-
are reset to their default value
46-
-V, --version Prints version information
41+
-h, --help Prints help information
42+
-V, --version Prints version information
4743
4844
OPTIONS:
49-
-a, --append-date <append-date>
50-
When provided, the habit data is queried and written to the diary at the specified date. The format of the
51-
date must be YYYY-MM-DD. If --fill is also set, this option serves a different purpose
5245
-d, --datafile <datafile>
5346
Path to the diary file. When not provided, its value is loaded from persistent configuration file
5447
@@ -61,12 +54,21 @@ OPTIONS:
6154
--max-displayed-cols <max-displayed-cols>
6255
Specifies the maximum allowed width of the terminal output. When not provided, its value is loaded from
6356
persistent configuration file
64-
--new <new>
65-
Provide a comma separated list of habit categories. A new diary file is created at the specified --datafile
66-
path
6757
-p, --past-periods <past-periods>
6858
Specifies the number of displayed periods when graphing the diary data. When not provided, its value is
6959
loaded from persistent configuration file
60+
61+
SUBCOMMANDS:
62+
fill If set, habit information for all the missing days is queried between --from-date and yesterday.
63+
If --from-date is not set, all the missing days are queried between the first entry in the diary
64+
and yesterday
65+
graph Displays the habit data according to the specified options to the terminal
66+
help Prints this message or the help of the given subcommand(s)
67+
insert Queries for habit information on the specified date
68+
list-config Prints the persistent configuration
69+
new Provide a comma separated list of habit categories. A new diary file is created at the specified
70+
--datafile path
71+
save-config Saves the specified options to persistent configuration
7072
```
7173

7274
## Building

0 commit comments

Comments
 (0)
Please sign in to comment.