Skip to content

Commit

Permalink
Deduplicate metadata in clap by using crate macros
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchane committed Sep 27, 2020
1 parent 1418335 commit f2274d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "newdoc"
version = "2.3.4"
description = "The newdoc tool generates pre-populated module and assembly files formatted with AsciiDoc, which are used in Red Hat and Fedora documentation. The generated files follow the template guidelines maintained by the Modular Documentation initiative: https://redhat-documentation.github.io/modular-docs/."
version = "2.3.5"
description = "Generate pre-populated module files formatted with AsciiDoc that are used in Red Hat and Fedora documentation."
authors = ["Marek Suchánek <[email protected]>"]
license = "GPL-3.0-or-later"
edition = "2018"
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::io::{self, Write};
use std::path::PathBuf;

extern crate clap;
use clap::{App, AppSettings, Arg, Values};
use clap::{App, AppSettings, Arg, crate_authors, crate_description, crate_name, crate_version, Values};

extern crate colored;
use colored::*;
Expand Down Expand Up @@ -69,10 +69,10 @@ struct Options {

fn main() {
// Define command-line options
let cmdline_args = App::new("newdoc")
.version("v2.3.4")
.author("Marek Suchánek")
.about("Generate an AsciiDoc file using a modular template")
let cmdline_args = App::new(crate_name!())
.version(crate_version!())
.author(crate_authors!())
.about(crate_description!())
// If no arguments are provided, print help
.setting(AppSettings::ArgRequiredElseHelp)
.arg(
Expand Down

0 comments on commit f2274d7

Please sign in to comment.