Skip to content

Commit f2274d7

Browse files
committed
Deduplicate metadata in clap by using crate macros
1 parent 1418335 commit f2274d7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "newdoc"
3-
version = "2.3.4"
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/."
3+
version = "2.3.5"
4+
description = "Generate pre-populated module files formatted with AsciiDoc that are used in Red Hat and Fedora documentation."
55
authors = ["Marek Suchánek <[email protected]>"]
66
license = "GPL-3.0-or-later"
77
edition = "2018"

src/main.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::io::{self, Write};
33
use std::path::PathBuf;
44

55
extern crate clap;
6-
use clap::{App, AppSettings, Arg, Values};
6+
use clap::{App, AppSettings, Arg, crate_authors, crate_description, crate_name, crate_version, Values};
77

88
extern crate colored;
99
use colored::*;
@@ -69,10 +69,10 @@ struct Options {
6969

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

0 commit comments

Comments
 (0)