File: no_version.rs

package info (click to toggle)
rust-structopt 0.3.26-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 796 kB
  • sloc: makefile: 2
file content (28 lines) | stat: -rw-r--r-- 614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! How to completely remove version.
//!
//! Running this example with --help prints this message:
//! -----------------------------------------------------
//! no_version
//!
//! USAGE:
//!     no_version
//!
//! FLAGS:
//!     -h, --help    Prints help information
//! -----------------------------------------------------

use structopt::clap::AppSettings;
use structopt::StructOpt;

#[derive(StructOpt, Debug)]
#[structopt(
    name = "no_version",
    no_version,
    global_settings = &[AppSettings::DisableVersion]
)]
struct Opt {}

fn main() {
    let opt = Opt::from_args();
    println!("{:?}", opt);
}