Skip to content

Commit a58b87a

Browse files
main.rs: included an example in the help output
1 parent 3b95622 commit a58b87a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/main.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
use clap::Parser;
2727
use clap_num::number_range;
2828
use file_format::FileFormat as FFmt;
29-
use indoc;
30-
use num_cpus;
3129
use std::error::Error;
3230
use std::str::from_utf8;
3331

@@ -52,23 +50,29 @@ fn prob_range(s: &str) -> Result<f64, String> {
5250
}
5351
}
5452

53+
5554
static CUSTOM_HELP_FORMAT: &str = indoc::indoc! {"
5655
{before-help}
56+
{name} {version}
57+
{author}
5758
{about-section}
5859
{usage-heading} {usage}
5960
60-
{all-args}
61+
{all-args} {after-help}
62+
"};
6163

62-
{name} {version}
63-
{author-with-newline}{after-help}
64+
const AFTER_HELP: &str = indoc::indoc! {"
65+
Examples:
66+
adapto-rs -t 4 -o samp_trim_1.fq.gz -p samp_trim_2.fq.gz samp_1.fq samp_2.fq
6467
"};
6568

6669
#[derive(Parser, Debug)]
67-
#[command(
70+
#[clap(
6871
author = "Andrew D. Smith <andrewds@usc.edu>",
6972
version,
7073
about,
7174
help_template = CUSTOM_HELP_FORMAT,
75+
after_help = AFTER_HELP,
7276
arg_required_else_help = true,
7377
)]
7478
struct Args {

0 commit comments

Comments
 (0)