An open API service indexing awesome lists of open source software.

https://github.com/lolei/rust-todo-cli

A command line tool written in Rust, of truly groundbreaking technological sophistication, the use cases of which will alter the way humanity will evolve for millennia to come.
https://github.com/lolei/rust-todo-cli

rust

Last synced: 3 months ago
JSON representation

A command line tool written in Rust, of truly groundbreaking technological sophistication, the use cases of which will alter the way humanity will evolve for millennia to come.

Awesome Lists containing this project

README

          

# rust-todo-cli
First project that's more than "hello world".

Performs CRUD operations on items in a database. The database implementation is easily
interchangeable. `lib.rs` could also be used by a different main binary, e.g. a web server/API.

Since this is just a practice project and the usability and use case is
questionable, it is not published on crates.io, but it can still be tested
locally by cloning this repository and running some of the following commands.

## Usage

### Compile
```
cargo build --release
```

### Run
```
./target/release/rust-todo-cli
# Or compile & run:
cargo run --release --
```

For simplicity's sake, below examples use the alias `rtc` for the binary.

### Help
```
rtc -h
Rust TODO CLI 0.1
Lorenz Leitner
CLI for managing TODOs

USAGE:
rtc [OPTIONS] <--add ...|--delete |--update |--filter ...|--getall>

FLAGS:
-g, --getall Get all items in the database
-h, --help Prints help information
-V, --version Prints version information

OPTIONS:
-a, --add ... Add an item, return ID
-d, --delete Delete an item
-f, --filter ... Filter items by name, status and/or date
-u, --update Update an item
```

### Examples
```
rtc -a my todo item
rtc -u 10 done
rtc -d 5
rtc -g
rtc -f status=open
rtc -f name='todo item'
rtc -f status=done after=2021-01-01 before=2021-01-05
```

### Testing
```
cargo test
```

### Clippy
Excluding some pedantic warnings:
```
./clippy.sh
```