Skip to content

Commit

Permalink
v0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
hitblast committed Dec 25, 2024
1 parent ea3e220 commit 018d70b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.1.8] - 2024.12.26

### Added

- `--emoji` flag for using emojis in the output (by @hitblast)

## [v0.1.7] - 2024.12.24

### Added
Expand Down
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
Expand Up @@ -2,7 +2,7 @@
name = "trimsec"
description = "Calculate saved time on using media speed multipliers, with speed."
authors = ["HitBlast <[email protected]>"]
version = "0.1.7"
version = "0.1.8"
edition = "2021"
repository = "https://github.com/hitblast/trimsec"
homepage = "https://github.com/hitblast/trimsec"
Expand Down
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- [x] `--version`
- [x] `--duration-only`
- [x] `--time-saved-only`
- [x] `--seconds`
- [x] `--emoji`
- [ ] `--raw`
- [ ] `--unit`
- [ ] Add an efficiency indicator for the time saved based on the leftover time for the day.
Expand Down
12 changes: 10 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ struct Cli {
/// Use seconds as the time unit.
#[clap(short, long)]
seconds: bool,
/// Show emojis in the output.
#[clap(short, long)]
emoji: bool,
}

/// Runner.
Expand All @@ -50,7 +53,8 @@ fn main() {
};

let message = format!(
"\nNew duration: {}",
"\nNew duration: {}{}",
if args.emoji { "⏳ " } else { r#""# },
if splits > 1 {
format!("{} ({} splits)", parsed, splits)
} else {
Expand All @@ -68,7 +72,11 @@ fn main() {
} else {
trimsec::parse_time(time_saved)
};
println!("Saved {}!\n", parsed.green());
println!(
"Saved {}{}!\n",
if args.emoji { "⏰ " } else { r#""# },
parsed.green()
);
}
}
Err(e) => {
Expand Down

0 comments on commit 018d70b

Please sign in to comment.