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...
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

qfetch is a tool that fetches info about your linux install.

qfetch qfetch is a tool that fetches info about your linux install. Status Dependencies /proc/meminfo with the following fields: MemTotal in the 1st l

Goodname is a tool to assist you with cool naming of your methods and software

Goodname is a tool to assist you with cool naming of your methods and software. Given a brief description of your method or software, this tool enumerates name candidates forming subsequences of the description (i.e., abbreviation).

A tool and library to losslessly join multiple .mp4 files shot with same camera and settings

mp4-merge A tool and library to losslessly join multiple .mp4 files shot with same camera and settings. This is useful to merge multiple files that ar

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 3 Oct 1, 2022
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 17 Aug 5, 2021
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 43 Nov 21, 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 59 Nov 9, 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
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
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

Sam Schlinkert 1 Aug 1, 2022
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

Felix Marezki 1 Apr 17, 2022