Skip to content

Commit 9aaa751

Browse files
committed
Add comments
1 parent 8530b41 commit 9aaa751

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ struct Cli {
5959
print_config: bool,
6060

6161
/// Opens a file, in `jrnl_folder`, with any name, just to add some notes.
62+
/// You can also use `--open e` to open `events.md` since it is a default file.
6263
#[arg(long, group = "main")]
6364
open: Option<String>,
6465

@@ -168,6 +169,7 @@ fn main() {
168169
};
169170
let args_open = match args.open.as_deref() {
170171
None => "",
172+
Some("e") => "events.md",
171173
Some(entry) => &entry,
172174
};
173175

src/utils.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,8 @@ pub fn gen_report_year(year: i32) {
10731073
println!("{}", table);
10741074
}
10751075

1076+
/// Read the `events.md` file located in `jrnl_folder`, and returns a Vector containing
1077+
/// a tuple of NaiveDate and the respective String.
10761078
pub fn read_events() -> Vec<(NaiveDate, String)> {
10771079
let file_result = File::open(format!("{}/jrnl_folder/events.md", get_default_path()));
10781080
let file = match file_result {

0 commit comments

Comments
 (0)