Skip to content

Commit

Permalink
improve docs, reorder lines for status
Browse files Browse the repository at this point in the history
  • Loading branch information
hardliner66 committed Apr 13, 2021
1 parent 7a981dd commit 8be3b98
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "timetracking"
description = "Simple time tracker with simple data format"
version = "1.3.5-alpha.0"
version = "1.3.5"
authors = ["hardliner66 <[email protected]>"]
edition = "2018"
license-file = "LICENSE"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ cargo install timetracking
## Commandline
```
USAGE:
tt [OPTIONS] <SUBCOMMAND>
tt [data-file] <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-d, --data-file <data-file> which data file to use
ARGS:
<data-file> which data file to use. [default: ~/timetracking.bin]
SUBCOMMANDS:
continue continue time tracking with last description
export export the file as json
export export data to file
help Prints this message or the help of the given subcommand(s)
import
import import data from json file
list list all entries
path show path to data file
show show work time for given timespan
Expand Down
13 changes: 10 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ use structopt::StructOpt;

#[derive(Debug, StructOpt)]
struct Options {
/// which data file to use
#[cfg(feature = "binary")]
/// which data file to use. [default: ~/timetracking.bin]
data_file: Option<PathBuf>,

#[cfg(not(feature = "binary"))]
/// which data file to use. [default: ~/timetracking.json]
#[structopt(short, long)]
data_file: Option<PathBuf>,

Expand Down Expand Up @@ -68,13 +73,14 @@ enum Command {
filter: Option<String>,
},
#[cfg(not(feature = "binary"))]
/// export data to file
Export {
/// where to write the output file
path: PathBuf,
},

#[cfg(feature = "binary")]
/// export the file as json
/// export data to file
Export {
/// export in a human readable format. This format is for human reading only and cannot be
/// imported
Expand All @@ -87,6 +93,7 @@ enum Command {
path: PathBuf,
},
#[cfg(feature = "binary")]
/// import data from json file
Import {
/// which file to import
path: PathBuf,
Expand Down Expand Up @@ -376,8 +383,8 @@ fn status(data: &[TrackingEvent]) {
let active = event.is_start();
let text = iif!(active, "Start", "End");
if let Some(description) = event.description() {
println!("Description: {}", description,);
println!("Active: {}", active);
println!("Description: {}", description,);
println!(
"{} Time: {:02}:{:02}:{:02}",
text,
Expand Down

0 comments on commit 8be3b98

Please sign in to comment.