Find out who to thank for the πŸ“¦s you use every day
Branch: master
Clone or download
brown121407 Merge pull request #2 from brown121407/develop
Update crate version to 0.2.0
Latest commit 3bb791a Feb 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src Add sorting by stars Feb 5, 2019
.gitignore Initial commit Jan 24, 2019
Cargo.lock
Cargo.toml Update crate version to 0.2.0 Feb 8, 2019
LICENSE Create LICENSE Jan 24, 2019
README.md
demo.gif Make errors prettier ✨ Jan 25, 2019

README.md

thank

Find out who to thank for the crates you use every day

What does this do?

Shows information (useful links and author details) about every crates you depend on in your projects. thank demo gif

Installation

Fire up a terminal and type:

cargo install --force thank

The --force argument is to ensure you get the latest version of this binary if you have a thank binary already installed.

Usage:

  • thank you - displays information about the crates you included under the [packages] section in your Cargo.toml
  • thank yall - displays information about all the crates your project depends on
  • thank god - displays information about this crate

Optional arguments:

  • -S, --stars - give 🌟s to the repos of your dependencies. (assumes you have a GitHub personal access token stored in an environment variable called GITHUB_TOKEN_THANK)
  • -f, --for <crate> - select a specific crate to display info about (and maybe to 🌟 it)
  • -s, --sort-by - sorting criterion, can be "name" or "stars"
  • -d, --descending - sort in descending order
  • --show-stars - show the number of GitHub 🌟s for each crate

For example, if you have serde in your dependecies and you want to display information only about it, the number of stars and also to star it, type:

thank you --for serde --show-stars --stars 

Why?

This project was inspired by the multitude of "thanks" projects out there. It's the first program I wrote in Rust (except from the classic Hello World), so doing this was a learning experience. I always thought you learn best by doing. Except for getting familiar with the language and tooling, I wanted this project to be yet another tool that makes the Rust community feel as awesome and friendly as it does.

Error codes

  • 100 => Input/Output and file system related errors
    • 101 => Could not get current working directory
    • 102 => Could not read Cargo.toml
  • 200 => Metadata and parsing related errors
    • 201 => Could not get output from cargo metadata
    • 202 => Could not parse output from cargo
    • 203 => The project has no dependencies
    • 204 => Could not process dependencies
    • 205 => Could not get packages vector from the crate's metadata
    • 206 => Could not parse Cargo.toml
  • 300 => GitHub stars and related stuff (for --with-stars)
    • 301 => Could not parse /:user/:repo from repository url
    • 302 => The request to star the repo failed
    • 303 => Could not find the GitHub token
    • 304 => No repository link found for a crate (using --for)
  • 400 => Specific crate errors (for --for=<crate>)
    • 401 => Could not find <crate> in your dependencies
    • 402 => Could not find <crate> in cargo metadata output