1 //! How to completely remove version. 2 //! 3 //! Running this example with --help prints this message: 4 //! ----------------------------------------------------- 5 //! no_version 6 //! 7 //! USAGE: 8 //! no_version 9 //! 10 //! FLAGS: 11 //! -h, --help Prints help information 12 //! ----------------------------------------------------- 13 14 use structopt::clap::AppSettings; 15 use structopt::StructOpt; 16 17 #[derive(StructOpt, Debug)] 18 #[structopt( 19 name = "no_version", 20 no_version, 21 global_settings = &[AppSettings::DisableVersion] 22 )] 23 struct Opt {} 24 main()25fn main() { 26 let opt = Opt::from_args(); 27 println!("{:?}", opt); 28 } 29