A tool to make grocery lists written in Rust

Overview

grusterylist: makes grocery lists, written in Rust

grusterylist uses and can add to local libraries of user-added recipes and grocery items to put together shopping lists

how to ...

  • run $ cargo run -- --help for available options
  • cargo run -- --list allows you to begin a new shopping list or use the most recently saved list.
    recipes.json, groceries.json, and list.json contain libraries of some recipes, groceries, and a saved list that could be emptied out manually to start from scratch.

example shopping list

Print out shopping list?  
--y  
--any other key to continue  
y  
We're making ...
	crispy tofu with cashews and blistered snap peas
We need ...
	extra firm tofu
	vegetable oil
	snap peas
	ginger
	garlic
	13 oz can of unsweetened coconut milk
	soy sauce
	honey
	cashews
	rice vinegar
	scallions
	red pepper flakes
	mint
	milk

in order to clone the repository and run the program using Rust ...

note

This is a learning project that uses:

  • clap for command line argument parsing
  • serde to deserialize and serialize JSON files
  • Rust's Result type and ? operator to handle errors.
  • custom error types (ReadError) in Rust
You might also like...
An open source WCH-Link library/command line tool written in Rust.

wlink - WCH-Link command line tool NOTE: This tool is still in development and not ready for production use. Known Issue: Only support binary firmware

Rust command-line tool to encrypt and decrypt files or directories with age

Bottle A Rust command-line tool that can compress and encrypt (and decrypt and extract) files or directories using age, gzip, and tar. Bottle has no c

A tool to use docker / podman / oci containers with rust

contain-rs A tool to use docker / podman / oci containers with rust TODO improve error types improve error reporting handle std error for child proces

A tool that helps you to turn in one command a Rust crate into a Haskell Cabal library!
A tool that helps you to turn in one command a Rust crate into a Haskell Cabal library!

cabal-pack A tool that helps you to turn in one command a Rust crate into a Haskell Cabal library! To generate bindings, you need to annotate the Rust

A cli tool to write your idea in terminal
A cli tool to write your idea in terminal

Ideas ideas is a cli tools to write your idea in your terminal. Demo Features tagged idea, contains tips, idea, todo status switch ascii icon write yo

πŸŽ¨πŸ¦€ A system information tool for Rustaceans
πŸŽ¨πŸ¦€ A system information tool for Rustaceans

🎨 πŸ¦€ ferris-fetch Inspired by gofetch πŸ’– πŸ› οΈ Cross platfrom System Info Tool for Rustaceans πŸ¦€ Installation πŸ”¨ cargo install ferris-fetch Contributin

A tool to deserialize data from an input encoding, transform it and serialize it back into an output encoding.

dts A simple tool to deserialize data from an input encoding, transform it and serialize it back into an output encoding. Requires rust = 1.56.0. Ins

Bioinformatics tool for counting guides in CRISPR-screen studies.
Bioinformatics tool for counting guides in CRISPR-screen studies.

guide-counter A better, faster way to count guides in CRISPR screens. Overview guide-counter is a tool for processing FASTQ files from CRISPR screen e

A tool & library to help you with the compiler course.

Compiler Course Helper Support: eliminate left recursion (require grammar with no cycles or Ο΅-production) calculate nullable, first sets, follow, sets

Comments
  • A lot of things are just strings. These could made type safe by creating types for these things and using shrinkwraprs to retain all the expected methods from string.

    A lot of things are just strings. These could made type safe by creating types for these things and using shrinkwraprs to retain all the expected methods from string.

    For example you have:

    struct GroceriesSection {
        section: String,
        items: Vec<String>,
    }
    struct Recipe {
        recipe: String,
        ingredients: Vec<String>,
    }
    struct ShoppingList {
        recipes_msg: String,
        recipes: Vec<String>,
        checklist_msg: String,
        checklist: Vec<String>,
        list_msg: String,
        list: Vec<String>,
    }
    

    Here the types do not make clear which items are used in which places. For example GroceriesSection::String is totally unrelated to the items in Recipe::ingredients. However GroceriesSection::items is the same. So rather than all of these being just String you could have types like:

    #[derive(Shrinkwrap)]
    struct RecipeName(String);
    #[derive(Shrinkwrap)]
    struct Ingredient{ name: String }
    ``
    etc. (using shrinkwraprs 3)
    This would make things like `ShoppingList` much easier to understand by looking at the struct.
    opened by suchapalaver 1
  • Sort out command line

    Sort out command line

    Right now clap isn't being used particularly correctly. Let's aim for arguments like the following for a start: cargo run -- recipe new "tofu chicken rice" --ingredients tofu rice chicken garlic And have the same minus the --ingredients flag run a default that asks the user for ingredients input

    opened by suchapalaver 0
  • Better organization

    Better organization

    For example Groceries contains write_to_file, read_from_file, and get_sections. These aren't really specific to the impl for a given instance of Groceries. It feels like maybe these should be made into a module rather than an impl block.

    opened by suchapalaver 0
  • a next step if you're into it--subcommands using clap

    a next step if you're into it--subcommands using clap

    I'm not a huge fan of running through asking what operation you want to perform. Maybe you could look into using subcommands with the clap crate, so if you want to add a recipe to the library you don't have to enter n a bunch of times.

    You could also make a help subcommand that prints some info and maybe with no subcommand you can run the same process you have.

    Once you have them broken into subcommands you'll see that running one after the other looks much cleaner too.

    opened by suchapalaver 0
Owner
null
Tools for managing GitHub block lists

GitHub block list management Octocrabby is a small set of command-line tools and Octocrab extensions that are focused on managing block lists on GitHu

Travis Brown 97 Nov 3, 2022
rust database for you to use and help me make!

Welcome To Rust Database! What is this? this is a database for you to git clone and use in your project! Why should i use it? It is fast and it takes

Carghai74 2 Dec 4, 2022
A collection of crates to make minecraft development (client, server) with rust possible.

rust-craft rust-craft is a collection of crates to make minecraft development (client, server) with rust possible. Motivation There's no better way of

JoΓ£o Victor 15 Mar 23, 2023
Make and use playgrounds locally.

cargo playground Cargo playground opens a local playground in the editor of your choice. Install You can install it directly using cargo $ cargo insta

null 18 Jan 3, 2023
Make a .scratch directory to keep random scribbles in

mkscratch Creates a directory named .scratch in your current working directory which will be ignored by Git. Useful for keeping around miscellaneous f

Kayla 3 Oct 21, 2022
A webring of people who make cool stuff. technology, music, art, writing, anything goes!

a webring of people who make cool stuff. technology, music, art, writing, anything goes!

Kognise 44 Dec 6, 2022
cargo-add command to make dependencies into dylibs

cargo add-dynamic This cargo command allows to wrap dependencies as dylibs. For why you might want this see Speeding up incremental Rust compilation w

Robert Krahn 62 Dec 27, 2022
Make your IDs strongly typed!!

About TypedId introduces a single type, aptly named TypedId. This is a generic wrapper any type, often types that you would use as an identifier. Howe

Tyler Bloom 8 Sep 2, 2022
A typed map which can make sure item exist.

Certain Map A typed map which can make sure item exist. What Problem Does It Solve In Rust, we often use Service abstraction for modular structure des

ihcη«₯ιž‹@提不衷劲 27 Jun 26, 2023
rusty-riscy is a performance testing and system resource monitoring tool written in Rust to benchmark RISC-V processors.

rusty-riscy rusty-riscy is a performance testing and system resource monitoring tool written in Rust to benchmark RISC-V processors. Objectives To cre

Suhas KV 4 May 3, 2022