Todo Swamp is a Rust-based command-line application for managing a todo list. It supports adding, searching, and marking todo items as done. The application is designed to handle large inputs efficiently.
- Add Todo Items: Add new todo items with descriptions and tags.
- Search Todo Items: Search for todo items based on words and tags.
- Mark Items as Done: Mark todo items as completed.
- Display Todo Items: Display todo items with their details.
The project is structured as follows:
├── .gitignore
├── Cargo.lock
├── Cargo.toml
├── README.md
├── rust-toolchain
├── src/
│ ├── bin/
│ │ └── application.rs
│ ├── lib.rs
│ ├── parser.rs
│ ├── query.rs
│ ├── runner.rs
│ └── todo_list.rs
├── tests/
│ ├── fixtures/
│ │ ├── Bishibosh (1).out
│ │ ├── Bishibosh.in
│ │ ├── FlamespFlamespike-The-CrawlerFlamespike-The-Crawlerike-The-Crawler.in
│ │ ├── FlamespFlamespike-The-CrawlerFlamespike-The-Crawlerike-The-Crawler.out
│ │ ├── sample.in
│ │ └── sample.out
│ ├── parser-test.rs
│ ├── query-test.rs
│ ├── runner-test.rs
│ ├── standard-test.rs
│ ├── test-cases.rs
│ └── todo-list-test.rs
The code is divided into the following modules:
This file contains the core data structures and implementations for the todo list, including:
- Index: Represents the index of a todo item.
- Description: Represents the description of a todo item.
- Tag: Represents a tag associated with a todo item.
- TodoItem: Represents a todo item.
- TodoList: Manages a list of todo items.
This file contains functions for parsing commands and inputs.
This file contains the logic for querying and searching todo items.
This file contains the main logic for running the application.
This directory contains test files for various modules of the application.
- Rust (latest stable version)
To build the project, run:
cargo build
To run the project, use the following command:
cargo run
To run the tests, use the following command:
cargo test
The application supports the following commands:
add
: Add a new todo item.search
: Search for todo items based on words and tags.done
: Mark a todo item as completed.
To add a new todo item, use the following command:
add "Buy groceries" #shopping, #groceries
To search for todo items, use the following command:
search groceries
To mark a todo item as completed, use the following command:
done 0
Note
After running cargo run, always first enter the number that represents how many commands you want to run.
3
add "Buy groceries" #shopping, #groceries
search groceries
done 0
This will add a todo item, search for todo items with the tag "groceries", and mark the first item as done.
This project is licensed under the MIT License. See the LICENSE file for details.
Happy coding! 🚀