From 0c8d48ad430c48c21d53806206257fc38d6e1eae Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 12 May 2022 00:04:50 -0700 Subject: [PATCH] Add subcommand metadata so `cargo --list` can print a description --- Cargo.lock | 7 +++++++ Cargo.toml | 1 + src/main.rs | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index cdbaae6..3efd799 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,11 +30,18 @@ name = "cargo-llvm-lines" version = "0.4.14" dependencies = [ "atty", + "cargo-subcommand-metadata", "clap", "rustc-demangle", "tempdir", ] +[[package]] +name = "cargo-subcommand-metadata" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33d3b80a8db16c4ad7676653766a8e59b5f95443c8823cb7cff587b90cb91ba" + [[package]] name = "clap" version = "3.1.5" diff --git a/Cargo.toml b/Cargo.toml index 2a047ab..8cc24f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ readme = "README.md" [dependencies] atty = "0.2" +cargo-subcommand-metadata = "0.1" clap = { version = "3.1", features = ["derive", "wrap_help"] } rustc-demangle = "0.1" tempdir = "0.3" diff --git a/src/main.rs b/src/main.rs index e2469c0..48db512 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,6 +23,10 @@ use std::process::{self, Command, Stdio}; use std::str::FromStr; use tempdir::TempDir; +cargo_subcommand_metadata::description!( + "Count the number of lines of LLVM IR across all instantiations of a generic function" +); + const ABOUT: &str = " Print amount of lines of LLVM IR that is generated for the current project.