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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! Create beautiful help messages.
//!
//! The syntax of the help message is explained in the [`sections`] macro.
//!
//! The syntax for styling text is explained in the [`text`] macro.
//!
//! ```
//! use helptext::{Help, sections};
//!
//! const HELP: Help = Help(sections!(
//! ["my-cool-program " {env!("CARGO_PKG_VERSION")}]
//! ["Use " c:"-h" " for short descriptions and " c:"--help" " for more details."]
//! []
//! "Usage" {
//! ["my-cool-program [OPTIONS] <INPUT>"]
//! }
//! "Options" {
//! table Auto {
//! "-h, --help" => {
//! ["Print help information"]
//! Long ["Use " c:"-h" " for short descriptions and " c:"--help" " for more details."]
//! }
//! "-p, --path <FILE>" => {
//! ["File containing the pomsky expression to compile"]
//! }
//! "-V, --version" => {
//! ["Print version information"]
//! }
//! "-W, --warnings <DIAGNOSTICS>" => {
//! Short ["Disable certain warnings (disable all with " c:"-W0" ")"]
//! Long ["Disable some or all warnings. A single warning can be disabled by specifying
//! the name followed by " c:"=0" ", for example:
//!
//! " c!"-Wcompat=0" "
//!
//! Multiple warnings can be disabled by setting this option multiple times, or
//! using a comma-separated list:
//!
//! " c!"-Wcompat=0 -Wdeprecated=0
//! -Wcompat=0,deprecated=0" "
//!
//! To disable all warnings, use " c:"-W0" ".
//!
//! Currently, the following warnings can be disabled:"]
//! Long table Compact {
//! "compat" => { ["Compatibility warnings"] }
//! "deprecated" => { ["A used feature will be removed in the future"] }
//! }
//! }
//! }
//! }
//! ));
//!
//! fn print_short_help(use_styles: bool) {
//! HELP.write(
//! &mut std::io::stdout().lock(),
//! false, // don't show long help
//! use_styles,
//! );
//! }
//!
//! fn print_long_help(use_styles: bool) {
//! HELP.write(
//! &mut std::io::stdout().lock(),
//! true, // show long help
//! use_styles,
//! );
//! }
//! ```
//!
//! Result:
//!
//! 
//!
//! 
pub use *;
pub use Style;