From 6acbf8de44b835a698a3b874c2a3af8c1727787a Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 17 May 2023 12:41:27 +0200 Subject: [PATCH] fancy help --- Cargo.toml | 1 - src/cplex/cli.rs | 6 +++++- src/main.rs | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 17b0911..3a26d79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,6 @@ description = "Various tools for use with math and cryptology, includes executab homepage = "https://git.cscherr.de/PlexSheep/plexcryptool/" repository = "https://git.cscherr.de/PlexSheep/plexcryptool/" license = "MIT" -license-file = "LICENSE" keywords = ["cryptology", "pyo3", "library", "dhbw"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/cplex/cli.rs b/src/cplex/cli.rs index 88c640e..e9740f3 100644 --- a/src/cplex/cli.rs +++ b/src/cplex/cli.rs @@ -11,7 +11,10 @@ use clap_num::maybe_hex; /// This is just structures for parsing Cli args #[derive(Parser, Debug, Clone)] -#[clap(name="plexcryptool", author="Christoph J. Scherr", version, about="Various tools for use with math and cryptology, includes executable and a library.")] +#[command(author, version, about, long_about)] // Read from `Cargo.toml` +#[command( + help_template = "{about-section}\n\t{name} {version}\n\tAuthor: {author-with-newline}\n{usage-heading} {usage} \n {all-args} {tab}" +)] pub struct Cli { /// Which submodule to use #[command(subcommand)] @@ -27,6 +30,7 @@ pub struct Cli { } #[derive(Subcommand, Debug, Clone)] +#[command(author, version, about, long_about = None)] // Read from `Cargo.toml` pub enum Commands { /// Use math functions Math(MathCommand), diff --git a/src/main.rs b/src/main.rs index 588b8d5..abc0569 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,6 +34,9 @@ use num_bigint; /// This function is the entrypoint of the binary. It parses Commandline options and calls the /// internal functions with the corresponding values, then shows the results to the user. pub fn main() { + //let b = as CommandFactory>::command(); + //dbg!(b.get_author()); + //return; let args = Cli::parse(); if args.verbose { cplex::printing::seperator();