Compare commits

5 Commits

Author SHA1 Message Date
Lukas Wölfer
140d5881af chore: add push command to bump script
All checks were successful
Rust / build_and_test (push) Successful in 23s
2026-01-30 18:17:43 +01:00
Lukas Wölfer
3d4fd8d048 chore: bump version to v0.3.0
All checks were successful
Release / build_release (push) Successful in 42s
Rust / build_and_test (push) Successful in 23s
2026-01-30 18:15:16 +01:00
Lukas Wölfer
cdc04ab266 style: add module documentation
Some checks failed
Rust / build_and_test (push) Has been cancelled
2026-01-30 18:14:41 +01:00
Lukas Wölfer
46aff0e6b1 feat: read checklist from file 2026-01-30 18:14:32 +01:00
Lukas Wölfer
cb99d74b4e chore: bump version to v0.2.0
All checks were successful
Release / build_release (push) Successful in 29s
Rust / build_and_test (push) Successful in 23s
2026-01-29 21:19:46 +01:00
6 changed files with 37 additions and 13 deletions

2
Cargo.lock generated
View File

@@ -147,7 +147,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chkr"
version = "0.1.0"
version = "0.3.0"
dependencies = [
"anyhow",
"argh",

View File

@@ -1,6 +1,6 @@
[package]
name = "chkr"
version = "0.1.0"
version = "0.3.0"
edition = "2024"
[dependencies]

View File

@@ -3,13 +3,25 @@
set -euo pipefail
VERSION="$(git cliff --bumped-version)"
sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" Cargo.toml
VERSION_CLEAN="${VERSION#v}"
sed -i "s/^version = \".*\"/version = \"${VERSION_CLEAN}\"/" Cargo.toml
cargo check
echo Press Y to commit version bump to ${VERSION}
echo Press Y to commit version bump to ${VERSION_CLEAN}
read -r CONFIRM
if [ "${CONFIRM}" != "Y" ]; then
echo Aborting
exit 1
fi
git commit -am "chore: bump version to ${VERSION}"
git tag -am "Version ${VERSION}" "${VERSION}"
git tag -am "Version ${VERSION}" "${VERSION}"
echo Press Y to push commit and tag
read -r CONFIRM
if [ "${CONFIRM}" != "Y" ]; then
echo Aborting
exit 1
fi
git push
git push --tags

View File

@@ -1,3 +1,4 @@
//! Abstraction around event sourcing for the checklist application.
use anyhow::Result;
use crossterm::event::{self, Event};
use std::time::Duration;

View File

@@ -1,10 +1,10 @@
/// A simple terminal checklist application.
//! A simple terminal checklist application.
mod event_source;
mod terminal_guard;
/// UI components (todo list)
mod todo_list;
use anyhow::{Context as _, Result, anyhow, bail};
use argh::FromArgs;
use core::time::Duration;
use crossterm::event::{self, EnableMouseCapture, Event, KeyCode};
use crossterm::execute;
@@ -16,11 +16,14 @@ use ratatui::backend::CrosstermBackend;
use std::io::{self, Read as _};
use terminal_guard::TerminalModeGuard;
use todo_list::TodoList;
use argh::FromArgs;
#[derive(FromArgs)]
/// chkr - terminal checklist
struct Args {
/// load checklist from file instead of stdin
#[argh(option, short = 'f', long = "file")]
file: Option<String>,
/// print version and exit
#[argh(switch, short = 'V', long = "version")]
version: bool,
@@ -34,13 +37,20 @@ fn main() -> Result<()> {
return Ok(());
}
let mut input = String::new();
io::stdin()
.read_to_string(&mut input)
.context("reading stdin")?;
let input: String = if let Some(path) = args.file {
std::fs::read_to_string(&path).with_context(|| format!("reading file {path}"))?
} else {
let mut input = String::new();
io::stdin()
.read_to_string(&mut input)
.context("reading stdin")?;
input
};
if input.trim().is_empty() {
eprintln!("Provide text via stdin (pipe or heredoc). Example: \n cat file.txt | chkr");
eprintln!(
"Provide text via stdin (pipe or heredoc), or use --file. Example: \n cat file.txt | chkr"
);
return Ok(());
}

View File

@@ -1,3 +1,4 @@
//! Todo list UI component for the checklist application.
use ratatui::style::Style;
use ratatui::widgets::{Block, Borders, List, ListItem, ListState};
// use Frame via the crate root type `ratatui::Frame` in the signature below