Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csplit: move help strings to markdown file #4474

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/uu/csplit/csplit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# csplit

```
csplit [OPTION]... FILE PATTERN...
```

Split a file into sections determined by context lines

## After Help

Output pieces of FILE separated by PATTERN(s) to files 'xx00', 'xx01', ..., and output byte counts of each piece to standard output.
10 changes: 5 additions & 5 deletions src/uu/csplit/src/csplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
use regex::Regex;
use uucore::display::Quotable;
use uucore::error::{FromIo, UResult};
use uucore::{crash_if_err, format_usage};
use uucore::{crash_if_err, format_usage, help_about, help_section, help_usage};

mod csplit_error;
mod patterns;
Expand All @@ -22,9 +22,9 @@ mod split_name;
use crate::csplit_error::CsplitError;
use crate::split_name::SplitName;

static ABOUT: &str = "Split a file into sections determined by context lines";
static LONG_HELP: &str = "Output pieces of FILE separated by PATTERN(s) to files 'xx00', 'xx01', ..., and output byte counts of each piece to standard output.";
const USAGE: &str = "{} [OPTION]... FILE PATTERN...";
const ABOUT: &str = help_about!("csplit.md");
const AFTER_HELP: &str = help_section!("after help", "csplit.md");
const USAGE: &str = help_usage!("csplit.md");

mod options {
pub const SUFFIX_FORMAT: &str = "suffix-format";
Expand Down Expand Up @@ -814,5 +814,5 @@ pub fn uu_app() -> Command {
.action(clap::ArgAction::Append)
.required(true),
)
.after_help(LONG_HELP)
.after_help(AFTER_HELP)
}