| //! `git.rs` serves as a demonstration of how to use subcommands, |
| //! as well as a demonstration of adding documentation to subcommands. |
| //! Documentation can be added either through doc comments or |
| //! `help`/`about` attributes. |
| //! Running this example with --help prints this message: |
| //! ----------------------------------------------------- |
| //! the stupid content tracker |
| //! -h, --help Prints help information |
| //! -V, --version Prints version information |
| //! fetch fetch branches from remote repository |
| //! help Prints this message or the help of the given subcommand(s) |
| //! ----------------------------------------------------- |
| use structopt::StructOpt; |
| #[derive(StructOpt, Debug)] |
| #[structopt(name = "git")] |
| /// the stupid content tracker |
| /// fetch branches from remote repository |
| #[structopt(default_value = "origin")] |
| #[structopt(help = "add files to the staging area")] |
| let matches = Opt::from_args(); |
| println!("{:?}", matches); |