Merge pull request #4474 from papparapa/csplit-move-help-strings-to-md-file

csplit: move help strings to markdown file
This commit is contained in:
Sylvestre Ledru 2023-03-07 17:33:51 +01:00 committed by GitHub
commit 68b58453df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

11
src/uu/csplit/csplit.md Normal file
View file

@ -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.

View file

@ -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;
@ -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";
@ -814,5 +814,5 @@ pub fn uu_app() -> Command {
.action(clap::ArgAction::Append)
.required(true),
)
.after_help(LONG_HELP)
.after_help(AFTER_HELP)
}