Skip to content

Commit

Permalink
Work around TeXitoi/structopt#333
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Apr 26, 2021
1 parent d30d889 commit 1386ba7
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ use structopt::StructOpt;
use log::{SetLoggerError, LevelFilter};
use crate::util::verbosify;

/// Command line options for configuring the logger with StructOpt.
///
/// It's recommended to use this in your program like this:
///
/// ```
/// #[derive(StructOpt, Debug)]
/// #[structopt(name="command")]
/// struct Command {
/// #[structopt(flatten)]
/// logging: LogOpts
/// }
/// ```
///
/// In your `main`, you can then call `opts.logging.init()` to initialize
/// the logging framework.
#[cfg_attr(not(doc), allow(missing_docs))]
#[cfg_attr(doc, doc=r#"
Command line options for configuring the logger with StructOpt.
It's recommended to use this in your program like this:
```
#[derive(StructOpt, Debug)]
#[structopt(name="command")]
struct Command {
#[structopt(flatten)]
logging: LogOpts
}
```
In your `main`, you can then call `opts.logging.init()` to initialize
the logging framework.
"#)]
#[derive(StructOpt, Debug)]
pub struct LogOpts {
/// Verbose mode (-v, -vv, -vvv, etc.)
Expand Down

0 comments on commit 1386ba7

Please sign in to comment.