mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 15:22:38 +00:00
Merge pull request #4828 from cakebaker/cp_fix_help_output
cp: fix "after help" output
This commit is contained in:
commit
ea26719e9a
1 changed files with 6 additions and 5 deletions
|
@ -299,7 +299,10 @@ pub fn uu_app() -> Command {
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.about(ABOUT)
|
.about(ABOUT)
|
||||||
.override_usage(format_usage(USAGE))
|
.override_usage(format_usage(USAGE))
|
||||||
.after_help(AFTER_HELP)
|
.after_help(format!(
|
||||||
|
"{AFTER_HELP}\n\n{}",
|
||||||
|
backup_control::BACKUP_CONTROL_LONG_HELP
|
||||||
|
))
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::TARGET_DIRECTORY)
|
Arg::new(options::TARGET_DIRECTORY)
|
||||||
|
@ -561,13 +564,11 @@ pub fn uu_app() -> Command {
|
||||||
|
|
||||||
#[uucore::main]
|
#[uucore::main]
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let matches = uu_app()
|
let matches = uu_app().try_get_matches_from(args);
|
||||||
.after_help(backup_control::BACKUP_CONTROL_LONG_HELP)
|
|
||||||
.try_get_matches_from(args);
|
|
||||||
|
|
||||||
// The error is parsed here because we do not want version or help being printed to stderr.
|
// The error is parsed here because we do not want version or help being printed to stderr.
|
||||||
if let Err(e) = matches {
|
if let Err(e) = matches {
|
||||||
let mut app = uu_app().after_help(backup_control::BACKUP_CONTROL_LONG_HELP);
|
let mut app = uu_app();
|
||||||
|
|
||||||
match e.kind() {
|
match e.kind() {
|
||||||
clap::error::ErrorKind::DisplayHelp => {
|
clap::error::ErrorKind::DisplayHelp => {
|
||||||
|
|
Loading…
Reference in a new issue