Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Feature `second-precision` to build bartib with the ability to track activities to the second (thank to [@johnDeSilencio](https://github.com/johnDeSilencio))
- Subcommand `search` to search the list of last activities for terms (thanks to [@Pyxels](https://github.com/Pyxels))
- Subcommand `status` to display the total duration of activities today, in the current week and in the current month (thanks to [@airenas](https://github.com/airenas))
- Option `--no-quotes` to `project` to suppres quotes in the projects list (thanks to [@defigli](https://github.com/defigli))
Expand Down
43 changes: 26 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
name = "bartib"
version = "1.1.0"
authors = ["Nikolas Schmidt-Voigt <nikolas.schmidt-voigt@posteo.de>"]
edition = "2018"
description = "A simple timetracker for the command line"
readme = "README.md"
homepage = "https://github.com/nikolassv/bartib"
repository = "https://github.com/nikolassv/bartib"
edition = "2018"
license = "GPL-3.0-or-later"
readme = "README.md"
keywords = ["cli"]
categories = ["command-line-utilities"]

Expand All @@ -17,30 +17,39 @@ path-guid = "BE8CBFAC-1DE6-4B0D-BB4B-C31A85A34AC5"
license = false
eula = false

# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.10.0"
# CI backends to support
ci = ["github"]
# The installers to generate for each app
installers = ["shell", "powershell", "msi"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
]
# Publish jobs to run in CI
pr-run-mode = "upload"

[dependencies]
anyhow = "1.0.0"
chrono = "0.4.0"
clap = "2.0.0"
thiserror = "1.0.0"
anyhow = "1.0.0"
nu-ansi-term = "0.46.0"
term_size = "0.3.0"
textwrap = "0.16.0"
thiserror = "1.0.0"
wildmatch = "2.3.0"

[features]
# Timestamps are recorded with second precision instead of the default minute precision
second-precision = []

# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"

# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.10.0"
# CI backends to support
ci = ["github"]
# The installers to generate for each app
installers = ["shell", "powershell", "msi"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# Publish jobs to run in CI
pr-run-mode = "upload"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Bartib is an easy to use time tracking tool for the command line. It saves a log
- [Via homebrew](#via-homebrew)
- [Via apk (Alpine Linux)](#via-apk-alpine-linux)
- [How to build Bartib](#how-to-build-bartib)
- [Precision](#precision)
- [How to define in which file to save the log of your activities](#how-to-define-in-which-file-to-save-the-log-of-your-activities)
- [How to edit or delete tracked activities](#how-to-edit-or-delete-tracked-activities)
- [How to activate auto completion](#how-to-activate-auto-completion)
Expand Down Expand Up @@ -186,6 +187,14 @@ Bartib is written in rust. You may build it yourself with the help of cargo. Jus
cargo build --release
```

#### Precision

By default, Bartib records timestamps in minutes. If you would like to record timestamps with second precision, you can enable the `second-precision` feature:

```bash
cargo build --features=second-precision --release
```

### How to define in which file to save the log of your activities

You may either specify the absolute path to your log as an extra parameter (`--file` or `-f`) to your bartib command:
Expand Down
13 changes: 12 additions & 1 deletion src/conf.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
use chrono::Duration;

pub static FORMAT_DATETIME: &str = "%F %R";
pub static FORMAT_MINUTE_PRECISION_DATETIME: &str = "%F %R";
pub static FORMAT_SECOND_PRECISION_DATETIME: &str = "%F %T";

#[cfg(not(feature = "second-precision"))]
pub static FORMAT_DATETIME: &str = FORMAT_MINUTE_PRECISION_DATETIME;
#[cfg(feature = "second-precision")]
pub static FORMAT_DATETIME: &str = FORMAT_SECOND_PRECISION_DATETIME;

#[cfg(not(feature = "second-precision"))]
pub static FORMAT_TIME: &str = "%R";
#[cfg(feature = "second-precision")]
pub static FORMAT_TIME: &str = "%T";

pub static FORMAT_DATE: &str = "%F";
pub static DEFAULT_WIDTH: usize = usize::MAX;
pub static REPORT_INDENTATION: usize = 4;
Expand Down
Loading