Giter Site home page Giter Site logo

list-rs's Introduction

list-rs

A simple clli todo app written in Rust.

$ list-rs    

Welcome to list-rs, a cli todo app written in Rust ๐Ÿฆ€!
Task list is empty. 
Run list-rs add to add a new task. 
Run list-rs --help to get all commands

Example Usage

Add task

$ list-rs add "Watch Oppenheimer"
Task Added

Remove a task by id

$ list-rs remove 3
Task 3 removed

Update a task by id

$ list-rs update 3 "A new title"
Task 3 updated

Set a task to Done

$ list-rs done 4
Task 4 set to Done

Set a task to Undone

$ list-rs undone 4
Task 4 set to Undone

Set a task to Archived

$ list-rs archive 4
Task 4 set to Archived

List all pending (undone) tasks

$ list-rs                    

4) โŒ› Take vitamins
3) โŒ› Meditate
2) โŒ› Go to the gym
1) โŒ› Watch Oppenheimer

List all tasks

$ list-rs all      

4) ๐Ÿ“ฆ Take vitamins
3) โŒ› Meditate
2) โœ… Go to the gym
1) โŒ› Watch Oppenheimer

Show archived tasks

$ list-rs archived

4) ๐Ÿ“ฆ Take vitamins

Search a task by its contents

$ list-rs search "Hello"   

6) โŒ› Hello World
5) โŒ› Hello

Functional Requirements

  • CRUD Operations: Add, Delete, Update, and List all tasks.
  • Automatic sorting by date created
  • Option to mark tasks as "Done," "Undone," and "Archived."
  • Task list persistent on disk using a database
  • Undo/Redo operations with infinite history
  • Search a task based on its content
  • Configurable database path

Future Work

  • Implement task due dates
  • Implement task tags
  • Interactive mode

Building

cargo b --release

Run tests

cargo t --release

Cli Arguments

$ list-rs --help
Usage: list-rs [COMMAND]

Commands:
  add       Adds a task
  remove    Removes a task with a given id
  update    Updates a task with a given id
  list      Lists all pending tasks
  all       List all tasks
  archived  List archived tasks
  archive   Sets a task with a given id to Archived
  done      Sets a task with a given id to Done
  undone    Sets a task with a given id to Undone
  search    Search for a task by its contents
  undo      Revert last change
  redo      Redo last change
  help      Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Setting a custom database path

Create a .env file and add the following line

DB_PATH=/your/custom/path/tasks.db

Crates Used

  • rusqlite (database)
  • clap (argument parsing)
  • colored (terminal pretty printing)
  • chrono (datetime stuff)
  • dotenv (for configuration purposes)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.