From 2e027bf45d717a47430008d963bcae55d2e5c567 Mon Sep 17 00:00:00 2001 From: Michael Debertol Date: Fri, 18 Jun 2021 12:00:08 +0200 Subject: [PATCH] true, false: enable --help and --version --- src/uu/false/src/false.rs | 7 +++---- src/uu/true/src/true.rs | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/uu/false/src/false.rs b/src/uu/false/src/false.rs index aaeb6b751..17c681129 100644 --- a/src/uu/false/src/false.rs +++ b/src/uu/false/src/false.rs @@ -5,15 +5,14 @@ // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. -use clap::{App, AppSettings}; +use clap::App; use uucore::executable; -pub fn uumain(_: impl uucore::Args) -> i32 { +pub fn uumain(args: impl uucore::Args) -> i32 { + uu_app().get_matches_from(args); 1 } pub fn uu_app() -> App<'static, 'static> { App::new(executable!()) - .setting(AppSettings::DisableHelpFlags) - .setting(AppSettings::DisableVersion) } diff --git a/src/uu/true/src/true.rs b/src/uu/true/src/true.rs index 521ca2ea5..ea53b0075 100644 --- a/src/uu/true/src/true.rs +++ b/src/uu/true/src/true.rs @@ -5,15 +5,14 @@ // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. -use clap::{App, AppSettings}; +use clap::App; use uucore::executable; -pub fn uumain(_: impl uucore::Args) -> i32 { +pub fn uumain(args: impl uucore::Args) -> i32 { + uu_app().get_matches_from(args); 0 } pub fn uu_app() -> App<'static, 'static> { App::new(executable!()) - .setting(AppSettings::DisableHelpFlags) - .setting(AppSettings::DisableVersion) }