Skip to content

Commit

Permalink
docs(yaml): make sure the doc-tests don't fail before "missing file"
Browse files Browse the repository at this point in the history
Removing an unused import is the only visible change.
  • Loading branch information
tormol committed Oct 16, 2016
1 parent 0ba9f4b commit 8c0f555
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/mod.rs
Expand Up @@ -130,11 +130,15 @@ impl<'a, 'b> App<'a, 'b> {
/// of an [`App`] struct.
///
/// ```ignore
/// # #[macro_use]
/// # extern crate clap;
/// # use clap::App;
/// # fn main() {
/// let yml = load_yaml!("app.yml");
/// let app = App::from_yaml(yml);
///
/// // continued logic goes here, such as `app.get_matches()` etc.
/// # }
/// ```
/// [`App`]: ./struct.App.html
/// [`examples/17_yaml.rs`]: https://github.com/kbknapp/clap-rs/blob/master/examples/17_yaml.rs
Expand Down
4 changes: 4 additions & 0 deletions src/args/arg.rs
Expand Up @@ -135,9 +135,13 @@ impl<'a, 'b> Arg<'a, 'b> {
/// # Examples
///
/// ```ignore
/// # #[macro_use]
/// # extern crate clap;
/// # use clap::Arg;
/// # fn main() {
/// let yml = load_yaml!("arg.yml");
/// let arg = Arg::from_yaml(yml);
/// # }
/// ```
/// [`Arg`]: ./struct.Arg.html
#[cfg(feature = "yaml")]
Expand Down
4 changes: 4 additions & 0 deletions src/args/group.rs
Expand Up @@ -119,9 +119,13 @@ impl<'a> ArgGroup<'a> {
/// # Examples
///
/// ```ignore
/// # #[macro_use]
/// # extern crate clap;
/// # use clap::ArgGroup;
/// # fn main() {
/// let yml = load_yaml!("group.yml");
/// let ag = ArgGroup::from_yaml(yml);
/// # }
/// ```
#[cfg(feature = "yaml")]
pub fn from_yaml(y: &'a Yaml) -> ArgGroup<'a> {
Expand Down
6 changes: 5 additions & 1 deletion src/args/subcommand.rs
Expand Up @@ -57,9 +57,13 @@ impl<'a> SubCommand<'a> {
/// # Examples
///
/// ```ignore
/// # use clap::{App, Arg, SubCommand};
/// # #[macro_use]
/// # extern crate clap;
/// # use clap::Subcommand;
/// # fn main() {
/// let sc_yaml = load_yaml!("test_subcommand.yml");
/// let sc = SubCommand::from_yaml(sc_yaml);
/// # }
/// ```
#[cfg(feature = "yaml")]
pub fn from_yaml(yaml: &Yaml) -> App {
Expand Down
4 changes: 4 additions & 0 deletions src/macros.rs
Expand Up @@ -13,11 +13,15 @@
/// of an `App` struct.
///
/// ```ignore
/// # #[macro_use]
/// # extern crate clap;
/// # use clap::App;
/// # fn main() {
/// let yml = load_yaml!("app.yml");
/// let app = App::from_yaml(yml);
///
/// // continued logic goes here, such as `app.get_matches()` etc.
/// # }
/// ```
#[cfg(feature = "yaml")]
#[macro_export]
Expand Down

0 comments on commit 8c0f555

Please sign in to comment.