1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

all: enable infer long arguments in clap

This commit is contained in:
Terts Diepraam 2022-01-28 21:48:09 +01:00
parent f1d72018d7
commit 9c8e865b55
97 changed files with 192 additions and 111 deletions

View file

@ -8,7 +8,7 @@
use platform_info::*; use platform_info::*;
use clap::{crate_version, App}; use clap::{crate_version, App, AppSettings};
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
static ABOUT: &str = "Display machine architecture"; static ABOUT: &str = "Display machine architecture";
@ -28,4 +28,5 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(SUMMARY) .after_help(SUMMARY)
.setting(AppSettings::InferLongArgs)
} }

View file

@ -18,7 +18,7 @@ use std::fs::File;
use std::io::{BufReader, Stdin}; use std::io::{BufReader, Stdin};
use std::path::Path; use std::path::Path;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
pub static BASE_CMD_PARSE_ERROR: i32 = 1; pub static BASE_CMD_PARSE_ERROR: i32 = 1;
@ -97,6 +97,7 @@ pub fn base_app(about: &str) -> App {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(about) .about(about)
.setting(AppSettings::InferLongArgs)
// Format arguments. // Format arguments.
.arg( .arg(
Arg::new(options::DECODE) Arg::new(options::DECODE)

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) fullname // spell-checker:ignore (ToDO) fullname
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::path::{is_separator, PathBuf}; use std::path::{is_separator, PathBuf};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UResult, UUsageError}; use uucore::error::{UResult, UUsageError};
@ -97,6 +97,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::MULTIPLE) Arg::new(options::MULTIPLE)
.short('a') .short('a')

View file

@ -36,9 +36,6 @@ const ENCODINGS: &[(&str, Format)] = &[
("base2lsbf", Format::Base2Lsbf), ("base2lsbf", Format::Base2Lsbf),
("base2msbf", Format::Base2Msbf), ("base2msbf", Format::Base2Msbf),
("z85", Format::Z85), ("z85", Format::Z85),
// common abbreviations. TODO: once we have clap 3.0 we can use `AppSettings::InferLongArgs` to get all abbreviations automatically
("base2l", Format::Base2Lsbf),
("base2m", Format::Base2Msbf),
]; ];
fn usage() -> String { fn usage() -> String {

View file

@ -14,7 +14,7 @@
extern crate unix_socket; extern crate unix_socket;
// last synced with: cat (GNU coreutils) 8.13 // last synced with: cat (GNU coreutils) 8.13
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::{metadata, File}; use std::fs::{metadata, File};
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use thiserror::Error; use thiserror::Error;
@ -245,6 +245,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.override_usage(SYNTAX) .override_usage(SYNTAX)
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::FILE) Arg::new(options::FILE)
.hide(true) .hide(true)

View file

@ -5,7 +5,7 @@
use uucore::error::{UResult, USimpleError, UUsageError}; use uucore::error::{UResult, USimpleError, UUsageError};
use uucore::{display::Quotable, show_error, show_warning}; use uucore::{display::Quotable, show_error, show_warning};
use clap::{App, Arg}; use clap::{App, AppSettings, Arg};
use selinux::{OpaqueSecurityContext, SecurityContext}; use selinux::{OpaqueSecurityContext, SecurityContext};
use std::borrow::Cow; use std::borrow::Cow;
@ -164,6 +164,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(VERSION) .version(VERSION)
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::dereference::DEREFERENCE) Arg::new(options::dereference::DEREFERENCE)
.long(options::dereference::DEREFERENCE) .long(options::dereference::DEREFERENCE)

View file

@ -12,7 +12,7 @@ pub use uucore::entries;
use uucore::error::{FromIo, UResult, USimpleError}; use uucore::error::{FromIo, UResult, USimpleError};
use uucore::perms::{chown_base, options, IfFrom}; use uucore::perms::{chown_base, options, IfFrom};
use clap::{App, Arg, ArgMatches}; use clap::{App, AppSettings, Arg, ArgMatches};
use std::fs; use std::fs;
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
@ -68,6 +68,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(VERSION) .version(VERSION)
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::verbosity::CHANGES) Arg::new(options::verbosity::CHANGES)
.short('c') .short('c')

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) Chmoder cmode fmode fperm fref ugoa RFILE RFILE's // spell-checker:ignore (ToDO) Chmoder cmode fmode fperm fref ugoa RFILE RFILE's
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs; use std::fs;
use std::os::unix::fs::{MetadataExt, PermissionsExt}; use std::os::unix::fs::{MetadataExt, PermissionsExt};
use std::path::Path; use std::path::Path;
@ -125,6 +125,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::CHANGES) Arg::new(options::CHANGES)
.long(options::CHANGES) .long(options::CHANGES)

View file

@ -13,7 +13,7 @@ use uucore::perms::{chown_base, options, IfFrom};
use uucore::error::{FromIo, UResult, USimpleError}; use uucore::error::{FromIo, UResult, USimpleError};
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use std::fs; use std::fs;
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
@ -71,6 +71,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::verbosity::CHANGES) Arg::new(options::verbosity::CHANGES)
.short('c') .short('c')

View file

@ -10,7 +10,7 @@
mod error; mod error;
use crate::error::ChrootError; use crate::error::ChrootError;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::ffi::CString; use std::ffi::CString;
use std::io::Error; use std::io::Error;
use std::path::Path; use std::path::Path;
@ -96,6 +96,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(SYNTAX) .override_usage(SYNTAX)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::NEWROOT) Arg::new(options::NEWROOT)
.hide(true) .hide(true)

View file

@ -6,7 +6,7 @@
// file that was distributed with this source code. // file that was distributed with this source code.
// spell-checker:ignore (ToDO) fname // spell-checker:ignore (ToDO) fname
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::File; use std::fs::File;
use std::io::{self, stdin, BufReader, Read}; use std::io::{self, stdin, BufReader, Read};
use std::path::Path; use std::path::Path;
@ -146,6 +146,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(SUMMARY) .about(SUMMARY)
.override_usage(SYNTAX) .override_usage(SYNTAX)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::FILE) Arg::new(options::FILE)
.hide(true) .hide(true)

View file

@ -15,7 +15,7 @@ use uucore::error::FromIo;
use uucore::error::UResult; use uucore::error::UResult;
use uucore::InvalidEncodingHandling; use uucore::InvalidEncodingHandling;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
static ABOUT: &str = "compare two sorted files line by line"; static ABOUT: &str = "compare two sorted files line by line";
static LONG_HELP: &str = ""; static LONG_HELP: &str = "";
@ -152,6 +152,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::COLUMN_1) Arg::new(options::COLUMN_1)
.short('1') .short('1')

View file

@ -27,7 +27,7 @@ use winapi::um::fileapi::GetFileInformationByHandle;
use std::borrow::Cow; use std::borrow::Cow;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use filetime::FileTime; use filetime::FileTime;
use quick_error::ResultExt; use quick_error::ResultExt;
use std::collections::HashSet; use std::collections::HashSet;
@ -300,6 +300,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg(Arg::new(options::TARGET_DIRECTORY) .arg(Arg::new(options::TARGET_DIRECTORY)
.short('t') .short('t')
.conflicts_with(options::NO_TARGET_DIRECTORY) .conflicts_with(options::NO_TARGET_DIRECTORY)

View file

@ -12,7 +12,7 @@ use std::{
io::{BufRead, BufWriter, Write}, io::{BufRead, BufWriter, Write},
}; };
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use regex::Regex; use regex::Regex;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -757,6 +757,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::SUFFIX_FORMAT) Arg::new(options::SUFFIX_FORMAT)
.short('b') .short('b')

View file

@ -11,7 +11,7 @@
extern crate uucore; extern crate uucore;
use bstr::io::BufReadExt; use bstr::io::BufReadExt;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write};
use std::path::Path; use std::path::Path;
@ -539,6 +539,7 @@ pub fn uu_app<'a>() -> App<'a> {
.override_usage(SYNTAX) .override_usage(SYNTAX)
.about(SUMMARY) .about(SUMMARY)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::BYTES) Arg::new(options::BYTES)
.short('b') .short('b')

View file

@ -11,7 +11,7 @@
use chrono::{DateTime, FixedOffset, Local, Offset, Utc}; use chrono::{DateTime, FixedOffset, Local, Offset, Utc};
#[cfg(windows)] #[cfg(windows)]
use chrono::{Datelike, Timelike}; use chrono::{Datelike, Timelike};
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "redox")))] #[cfg(all(unix, not(target_os = "macos"), not(target_os = "redox")))]
use libc::{clock_settime, timespec, CLOCK_REALTIME}; use libc::{clock_settime, timespec, CLOCK_REALTIME};
use std::fs::File; use std::fs::File;
@ -261,6 +261,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_DATE) Arg::new(OPT_DATE)
.short('d') .short('d')

View file

@ -36,7 +36,7 @@ use std::thread;
use std::time; use std::time;
use byte_unit::Byte; use byte_unit::Byte;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use gcd::Gcd; use gcd::Gcd;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
use signal_hook::consts::signal; use signal_hook::consts::signal;
@ -941,6 +941,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::INFILE) Arg::new(options::INFILE)
.long(options::INFILE) .long(options::INFILE)

View file

@ -12,7 +12,7 @@ use uucore::error::UResult;
use uucore::fsext::statfs_fn; use uucore::fsext::statfs_fn;
use uucore::fsext::{read_fs_list, FsUsage, MountInfo}; use uucore::fsext::{read_fs_list, FsUsage, MountInfo};
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use number_prefix::NumberPrefix; use number_prefix::NumberPrefix;
use std::cell::Cell; use std::cell::Cell;
@ -425,6 +425,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_ALL) Arg::new(OPT_ALL)
.short('a') .short('a')

View file

@ -13,7 +13,7 @@ use std::env;
use std::fs::File; use std::fs::File;
use std::io::{BufRead, BufReader}; use std::io::{BufRead, BufReader};
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UResult, USimpleError, UUsageError}; use uucore::error::{UResult, USimpleError, UUsageError};
@ -165,6 +165,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(SUMMARY) .about(SUMMARY)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::BOURNE_SHELL) Arg::new(options::BOURNE_SHELL)
.long("sh") .long("sh")

View file

@ -5,7 +5,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::path::Path; use std::path::Path;
use uucore::display::print_verbatim; use uucore::display::print_verbatim;
use uucore::error::{UResult, UUsageError}; use uucore::error::{UResult, UUsageError};
@ -87,6 +87,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.about(ABOUT) .about(ABOUT)
.version(crate_version!()) .version(crate_version!())
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::ZERO) Arg::new(options::ZERO)
.long(options::ZERO) .long(options::ZERO)

View file

@ -10,8 +10,7 @@ extern crate uucore;
use chrono::prelude::DateTime; use chrono::prelude::DateTime;
use chrono::Local; use chrono::Local;
use clap::ArgMatches; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use clap::{crate_version, App, Arg};
use std::collections::HashSet; use std::collections::HashSet;
use std::convert::TryFrom; use std::convert::TryFrom;
use std::env; use std::env;
@ -630,6 +629,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(SUMMARY) .about(SUMMARY)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::ALL) Arg::new(options::ALL)
.short('a') .short('a')
@ -644,7 +644,6 @@ pub fn uu_app<'a>() -> App<'a> {
although the apparent size is usually smaller, it may be larger due to holes \ although the apparent size is usually smaller, it may be larger due to holes \
in ('sparse') files, internal fragmentation, indirect blocks, and the like" in ('sparse') files, internal fragmentation, indirect blocks, and the like"
) )
.alias("app") // The GNU test suite uses this alias
) )
.arg( .arg(
Arg::new(options::BLOCK_SIZE) Arg::new(options::BLOCK_SIZE)
@ -753,7 +752,6 @@ pub fn uu_app<'a>() -> App<'a> {
Arg::new(options::THRESHOLD) Arg::new(options::THRESHOLD)
.short('t') .short('t')
.long(options::THRESHOLD) .long(options::THRESHOLD)
.alias("th")
.value_name("SIZE") .value_name("SIZE")
.number_of_values(1) .number_of_values(1)
.allow_hyphen_values(true) .allow_hyphen_values(true)

View file

@ -6,7 +6,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::io::{self, Write}; use std::io::{self, Write};
use std::iter::Peekable; use std::iter::Peekable;
use std::str::Chars; use std::str::Chars;
@ -134,8 +134,9 @@ pub fn uu_app<'a>() -> App<'a> {
// TrailingVarArg specifies the final positional argument is a VarArg // TrailingVarArg specifies the final positional argument is a VarArg
// and it doesn't attempts the parse any further args. // and it doesn't attempts the parse any further args.
// Final argument must have multiple(true) or the usage string equivalent. // Final argument must have multiple(true) or the usage string equivalent.
.setting(clap::AppSettings::TrailingVarArg) .setting(AppSettings::TrailingVarArg)
.setting(clap::AppSettings::AllowHyphenValues) .setting(AppSettings::AllowHyphenValues)
.setting(AppSettings::InferLongArgs)
.version(crate_version!()) .version(crate_version!())
.about(SUMMARY) .about(SUMMARY)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)

View file

@ -127,6 +127,7 @@ pub fn uu_app<'a>() -> App<'a> {
.override_usage(USAGE) .override_usage(USAGE)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.setting(AppSettings::AllowExternalSubcommands) .setting(AppSettings::AllowExternalSubcommands)
.setting(AppSettings::InferLongArgs)
.arg(Arg::new("ignore-environment") .arg(Arg::new("ignore-environment")
.short('i') .short('i')
.long("ignore-environment") .long("ignore-environment")

View file

@ -12,7 +12,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
use std::str::from_utf8; use std::str::from_utf8;
@ -184,6 +184,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::INITIAL) Arg::new(options::INITIAL)
.long(options::INITIAL) .long(options::INITIAL)

View file

@ -5,7 +5,7 @@
//* For the full copyright and license information, please view the LICENSE //* For the full copyright and license information, please view the LICENSE
//* file that was distributed with this source code. //* file that was distributed with this source code.
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
use uucore::InvalidEncodingHandling; use uucore::InvalidEncodingHandling;
@ -17,6 +17,7 @@ const HELP: &str = "help";
pub fn uu_app<'a>() -> App<'a> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.setting(AppSettings::InferLongArgs)
.arg(Arg::new(VERSION).long(VERSION)) .arg(Arg::new(VERSION).long(VERSION))
.arg(Arg::new(HELP).long(HELP)) .arg(Arg::new(HELP).long(HELP))
} }

View file

@ -14,7 +14,7 @@ use std::fmt::Write as FmtWrite;
use std::io::{self, stdin, stdout, BufRead, Write}; use std::io::{self, stdin, stdout, BufRead, Write};
mod factor; mod factor;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
pub use factor::*; pub use factor::*;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::UResult; use uucore::error::UResult;
@ -81,5 +81,6 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg(Arg::new(options::NUMBER).multiple_occurrences(true)) .arg(Arg::new(options::NUMBER).multiple_occurrences(true))
} }

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::cmp; use std::cmp;
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, Write}; use std::io::{stdin, stdout, Write};
@ -226,6 +226,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_CROWN_MARGIN) Arg::new(OPT_CROWN_MARGIN)
.short('c') .short('c')

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDOs) ncount routput // spell-checker:ignore (ToDOs) ncount routput
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::File; use std::fs::File;
use std::io::{stdin, BufRead, BufReader, Read}; use std::io::{stdin, BufRead, BufReader, Read};
use std::path::Path; use std::path::Path;
@ -69,6 +69,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.override_usage(SYNTAX) .override_usage(SYNTAX)
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::BYTES) Arg::new(options::BYTES)
.long(options::BYTES) .long(options::BYTES)

View file

@ -25,7 +25,7 @@ use uucore::{
error::{UError, UResult}, error::{UError, UResult},
}; };
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
mod options { mod options {
pub const USERS: &str = "USERNAME"; pub const USERS: &str = "USERNAME";
@ -109,6 +109,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::USERS) Arg::new(options::USERS)
.multiple_occurrences(true) .multiple_occurrences(true)

View file

@ -20,7 +20,7 @@ mod digest;
use self::digest::Digest; use self::digest::Digest;
use self::digest::DigestWriter; use self::digest::DigestWriter;
use clap::{App, Arg, ArgMatches}; use clap::{App, AppSettings, Arg, ArgMatches};
use hex::ToHex; use hex::ToHex;
use md5::Context as Md5; use md5::Context as Md5;
use regex::Regex; use regex::Regex;
@ -343,6 +343,7 @@ pub fn uu_app_common<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about("Compute and check message digests.") .about("Compute and check message digests.")
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new("binary") Arg::new("binary")
.short('b') .short('b')

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (vars) zlines BUFWRITER seekable // spell-checker:ignore (vars) zlines BUFWRITER seekable
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::convert::{TryFrom, TryInto}; use std::convert::{TryFrom, TryInto};
use std::ffi::OsString; use std::ffi::OsString;
use std::io::{self, BufWriter, ErrorKind, Read, Seek, SeekFrom, Write}; use std::io::{self, BufWriter, ErrorKind, Read, Seek, SeekFrom, Write};
@ -47,6 +47,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(USAGE) .override_usage(USAGE)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::BYTES_NAME) Arg::new(options::BYTES_NAME)
.short('c') .short('c')

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) gethostid // spell-checker:ignore (ToDO) gethostid
use clap::{crate_version, App}; use clap::{crate_version, App, AppSettings};
use libc::c_long; use libc::c_long;
use uucore::error::UResult; use uucore::error::UResult;
@ -29,6 +29,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.override_usage(SYNTAX) .override_usage(SYNTAX)
.setting(AppSettings::InferLongArgs)
} }
fn hostid() { fn hostid() {

View file

@ -11,7 +11,7 @@ use std::collections::hash_set::HashSet;
use std::net::ToSocketAddrs; use std::net::ToSocketAddrs;
use std::str; use std::str;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -76,6 +76,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_DOMAIN) Arg::new(OPT_DOMAIN)
.short('d') .short('d')

View file

@ -39,7 +39,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::ffi::CStr; use std::ffi::CStr;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::entries::{self, Group, Locate, Passwd}; use uucore::entries::{self, Group, Locate, Passwd};
@ -351,6 +351,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::OPT_AUDIT) Arg::new(options::OPT_AUDIT)
.short('A') .short('A')

View file

@ -12,7 +12,7 @@ mod mode;
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use file_diff::diff; use file_diff::diff;
use filetime::{set_file_times, FileTime}; use filetime::{set_file_times, FileTime};
use uucore::backup_control::{self, BackupMode}; use uucore::backup_control::{self, BackupMode};
@ -196,6 +196,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
backup_control::arguments::backup() backup_control::arguments::backup()
) )

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::cmp::Ordering; use std::cmp::Ordering;
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufRead, BufReader, Split, Stdin, Write}; use std::io::{stdin, stdout, BufRead, BufReader, Split, Stdin, Write};
@ -600,6 +600,7 @@ standard output. The default join field is the first, delimited by blanks.
When FILE1 or FILE2 (not both) is -, read standard input.", When FILE1 or FILE2 (not both) is -, read standard input.",
) )
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new("a") Arg::new("a")
.short('a') .short('a')

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use libc::{c_int, pid_t}; use libc::{c_int, pid_t};
use std::io::Error; use std::io::Error;
use uucore::display::Quotable; use uucore::display::Quotable;
@ -82,6 +82,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::LIST) Arg::new(options::LIST)
.short('l') .short('l')

View file

@ -4,7 +4,7 @@
// * // *
// * For the full copyright and license information, please view the LICENSE // * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code. // * file that was distributed with this source code.
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::hard_link; use std::fs::hard_link;
use std::path::Path; use std::path::Path;
use uucore::display::Quotable; use uucore::display::Quotable;
@ -40,6 +40,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::FILES) Arg::new(options::FILES)
.hide(true) .hide(true)

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UError, UResult}; use uucore::error::{UError, UResult};
@ -183,6 +183,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg(backup_control::arguments::backup()) .arg(backup_control::arguments::backup())
.arg(backup_control::arguments::backup_no_args()) .arg(backup_control::arguments::backup_no_args())
// TODO: opts.arg( // TODO: opts.arg(

View file

@ -12,7 +12,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App}; use clap::{crate_version, App, AppSettings};
use std::ffi::CStr; use std::ffi::CStr;
use uucore::error::UResult; use uucore::error::UResult;
use uucore::InvalidEncodingHandling; use uucore::InvalidEncodingHandling;
@ -59,4 +59,5 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
} }

View file

@ -15,7 +15,7 @@ extern crate lazy_static;
mod quoting_style; mod quoting_style;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use glob::Pattern; use glob::Pattern;
use lscolors::LsColors; use lscolors::LsColors;
use number_prefix::NumberPrefix; use number_prefix::NumberPrefix;
@ -709,6 +709,7 @@ pub fn uu_app<'a>() -> App<'a> {
the command line, expect that it will ignore files and directories \ the command line, expect that it will ignore files and directories \
whose names start with '.'.", whose names start with '.'.",
) )
.setting(AppSettings::InferLongArgs)
// Format arguments // Format arguments
.arg( .arg(
Arg::new(options::FORMAT) Arg::new(options::FORMAT)

View file

@ -10,8 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::OsValues; use clap::{crate_version, App, AppSettings, Arg, ArgMatches, OsValues};
use clap::{crate_version, App, Arg, ArgMatches};
use std::fs; use std::fs;
use std::path::Path; use std::path::Path;
use uucore::display::Quotable; use uucore::display::Quotable;
@ -114,6 +113,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::MODE) Arg::new(options::MODE)
.short('m') .short('m')
@ -125,7 +125,6 @@ pub fn uu_app<'a>() -> App<'a> {
Arg::new(options::PARENTS) Arg::new(options::PARENTS)
.short('p') .short('p')
.long(options::PARENTS) .long(options::PARENTS)
.alias("parent")
.help("make parent directories as needed"), .help("make parent directories as needed"),
) )
.arg( .arg(

View file

@ -8,7 +8,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use libc::mkfifo; use libc::mkfifo;
use std::ffi::CString; use std::ffi::CString;
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
@ -75,6 +75,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.override_usage(USAGE) .override_usage(USAGE)
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::MODE) Arg::new(options::MODE)
.short('m') .short('m')

View file

@ -9,7 +9,7 @@
use std::ffi::CString; use std::ffi::CString;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use libc::{dev_t, mode_t}; use libc::{dev_t, mode_t};
use libc::{S_IFBLK, S_IFCHR, S_IFIFO, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR}; use libc::{S_IFBLK, S_IFCHR, S_IFIFO, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR};
@ -149,6 +149,7 @@ pub fn uu_app<'a>() -> App<'a> {
.override_usage(USAGE) .override_usage(USAGE)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new("mode") Arg::new("mode")
.short('m') .short('m')

View file

@ -8,7 +8,7 @@
// spell-checker:ignore (paths) GPGHome // spell-checker:ignore (paths) GPGHome
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use uucore::display::{println_verbatim, Quotable}; use uucore::display::{println_verbatim, Quotable};
use uucore::error::{FromIo, UError, UResult}; use uucore::error::{FromIo, UError, UResult};
@ -139,6 +139,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_DIRECTORY) Arg::new(OPT_DIRECTORY)
.short('d') .short('d')

View file

@ -17,7 +17,7 @@ use std::{
#[cfg(all(unix, not(target_os = "fuchsia")))] #[cfg(all(unix, not(target_os = "fuchsia")))]
extern crate nix; extern crate nix;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use crossterm::{ use crossterm::{
event::{self, Event, KeyCode, KeyEvent, KeyModifiers}, event::{self, Event, KeyCode, KeyEvent, KeyModifiers},
execute, queue, execute, queue,
@ -100,6 +100,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.about("A file perusal filter for CRT viewing.") .about("A file perusal filter for CRT viewing.")
.version(crate_version!()) .version(crate_version!())
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::SILENT) Arg::new(options::SILENT)
.short('d') .short('d')

View file

@ -13,7 +13,7 @@ mod error;
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use std::env; use std::env;
use std::ffi::OsString; use std::ffi::OsString;
use std::fs; use std::fs;
@ -123,6 +123,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
backup_control::arguments::backup() backup_control::arguments::backup()
) )

View file

@ -110,6 +110,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app<'a>() -> App<'a> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.setting(AppSettings::TrailingVarArg) .setting(AppSettings::TrailingVarArg)
.setting(AppSettings::InferLongArgs)
.version(crate_version!()) .version(crate_version!())
.arg( .arg(
Arg::new(options::ADJUSTMENT) Arg::new(options::ADJUSTMENT)

View file

@ -8,7 +8,7 @@
// spell-checker:ignore (ToDO) corasick memchr // spell-checker:ignore (ToDO) corasick memchr
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::File; use std::fs::File;
use std::io::{stdin, BufRead, BufReader, Read}; use std::io::{stdin, BufRead, BufReader, Read};
use std::iter::repeat; use std::iter::repeat;
@ -145,6 +145,7 @@ pub fn uu_app<'a>() -> App<'a> {
.name(NAME) .name(NAME)
.version(crate_version!()) .version(crate_version!())
.override_usage(USAGE) .override_usage(USAGE)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::FILE) Arg::new(options::FILE)
.hide(true) .hide(true)

View file

@ -126,6 +126,7 @@ pub fn uu_app<'a>() -> App<'a> {
.multiple_occurrences(true), .multiple_occurrences(true),
) )
.setting(AppSettings::TrailingVarArg) .setting(AppSettings::TrailingVarArg)
.setting(AppSettings::InferLongArgs)
} }
fn replace_fds() -> UResult<()> { fn replace_fds() -> UResult<()> {

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) NPROCESSORS nprocs numstr threadstr sysconf // spell-checker:ignore (ToDO) NPROCESSORS nprocs numstr threadstr sysconf
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::env; use std::env;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
@ -75,6 +75,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_ALL) Arg::new(OPT_ALL)
.long(OPT_ALL) .long(OPT_ALL)

View file

@ -196,6 +196,7 @@ pub fn uu_app<'a>() -> App<'a> {
.about(ABOUT) .about(ABOUT)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.setting(AppSettings::AllowNegativeNumbers) .setting(AppSettings::AllowNegativeNumbers)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::DELIMITER) Arg::new(options::DELIMITER)
.short('d') .short('d')

View file

@ -295,7 +295,8 @@ pub fn uu_app<'a>() -> App<'a> {
.setting( .setting(
AppSettings::TrailingVarArg | AppSettings::TrailingVarArg |
AppSettings::DontDelimitTrailingValues | AppSettings::DontDelimitTrailingValues |
AppSettings::DeriveDisplayOrder AppSettings::DeriveDisplayOrder |
AppSettings::InferLongArgs
) )
.arg( .arg(
Arg::new(options::ADDRESS_RADIX) Arg::new(options::ADDRESS_RADIX)

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) delim // spell-checker:ignore (ToDO) delim
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::File; use std::fs::File;
use std::io::{stdin, BufRead, BufReader, Read}; use std::io::{stdin, BufRead, BufReader, Read};
use std::iter::repeat; use std::iter::repeat;
@ -52,6 +52,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::SERIAL) Arg::new(options::SERIAL)
.long(options::SERIAL) .long(options::SERIAL)

View file

@ -8,7 +8,7 @@
// * that was distributed with this source code. // * that was distributed with this source code.
// spell-checker:ignore (ToDO) lstat // spell-checker:ignore (ToDO) lstat
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs; use std::fs;
use std::io::{ErrorKind, Write}; use std::io::{ErrorKind, Write};
use uucore::display::Quotable; use uucore::display::Quotable;
@ -92,6 +92,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::POSIX) Arg::new(options::POSIX)
.short('p') .short('p')

View file

@ -18,7 +18,7 @@ use std::io::BufReader;
use std::fs::File; use std::fs::File;
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::path::PathBuf; use std::path::PathBuf;
use uucore::InvalidEncodingHandling; use uucore::InvalidEncodingHandling;
@ -136,6 +136,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::LONG_FORMAT) Arg::new(options::LONG_FORMAT)
.short('l') .short('l')

View file

@ -13,7 +13,7 @@ extern crate quick_error;
use chrono::offset::Local; use chrono::offset::Local;
use chrono::DateTime; use chrono::DateTime;
use clap::App; use clap::{App, AppSettings};
use getopts::Matches; use getopts::Matches;
use getopts::{HasArg, Occur}; use getopts::{HasArg, Occur};
use itertools::Itertools; use itertools::Itertools;
@ -172,7 +172,7 @@ quick_error! {
} }
pub fn uu_app<'a>() -> App<'a> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name()).setting(AppSettings::InferLongArgs)
} }
#[uucore_procs::gen_uumain] #[uucore_procs::gen_uumain]

View file

@ -7,7 +7,7 @@
/* last synced with: printenv (GNU coreutils) 8.13 */ /* last synced with: printenv (GNU coreutils) 8.13 */
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::env; use std::env;
use uucore::error::UResult; use uucore::error::UResult;
@ -65,6 +65,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_NULL) Arg::new(OPT_NULL)
.short('0') .short('0')

View file

@ -2,7 +2,7 @@
// spell-checker:ignore (change!) each's // spell-checker:ignore (change!) each's
// spell-checker:ignore (ToDO) LONGHELP FORMATSTRING templating parameterizing formatstr // spell-checker:ignore (ToDO) LONGHELP FORMATSTRING templating parameterizing formatstr
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use uucore::error::{UResult, UUsageError}; use uucore::error::{UResult, UUsageError};
use uucore::memo; use uucore::memo;
use uucore::InvalidEncodingHandling; use uucore::InvalidEncodingHandling;
@ -297,4 +297,5 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.arg(Arg::new(VERSION).long(VERSION)) .arg(Arg::new(VERSION).long(VERSION))
.arg(Arg::new(HELP).long(HELP)) .arg(Arg::new(HELP).long(HELP))
.setting(AppSettings::InferLongArgs)
} }

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDOs) corasick memchr Roff trunc oset iset // spell-checker:ignore (ToDOs) corasick memchr Roff trunc oset iset
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use regex::Regex; use regex::Regex;
use std::cmp; use std::cmp;
use std::collections::{BTreeSet, HashMap, HashSet}; use std::collections::{BTreeSet, HashMap, HashSet};
@ -705,6 +705,7 @@ pub fn uu_app<'a>() -> App<'a> {
.name(NAME) .name(NAME)
.version(crate_version!()) .version(crate_version!())
.override_usage(BRIEF) .override_usage(BRIEF)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::FILE) Arg::new(options::FILE)
.hide(true) .hide(true)

View file

@ -5,7 +5,7 @@
// * For the full copyright and license information, please view the LICENSE // * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code. // * file that was distributed with this source code.
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::env; use std::env;
use std::io; use std::io;
use std::path::PathBuf; use std::path::PathBuf;
@ -156,6 +156,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_LOGICAL) Arg::new(OPT_LOGICAL)
.short('L') .short('L')

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs; use std::fs;
use std::io::{stdout, Write}; use std::io::{stdout, Write};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@ -102,6 +102,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_CANONICALIZE) Arg::new(OPT_CANONICALIZE)
.short('f') .short('f')

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::{ use std::{
io::{stdout, Write}, io::{stdout, Write},
path::{Path, PathBuf}, path::{Path, PathBuf},
@ -78,6 +78,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_QUIET) Arg::new(OPT_QUIET)
.short('q') .short('q')

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) subpath absto absfrom absbase // spell-checker:ignore (ToDO) subpath absto absfrom absbase
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::env; use std::env;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use uucore::display::println_verbatim; use uucore::display::println_verbatim;
@ -86,6 +86,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg(Arg::new(options::DIR).short('d').takes_value(true).help( .arg(Arg::new(options::DIR).short('d').takes_value(true).help(
"If any of FROM and TO is not subpath of DIR, output absolute path instead of relative", "If any of FROM and TO is not subpath of DIR, output absolute path instead of relative",
)) ))

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use remove_dir_all::remove_dir_all; use remove_dir_all::remove_dir_all;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::fs; use std::fs;
@ -149,7 +149,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_FORCE) Arg::new(OPT_FORCE)
.short('f') .short('f')

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::{read_dir, remove_dir}; use std::fs::{read_dir, remove_dir};
use std::io; use std::io;
use std::path::Path; use std::path::Path;
@ -179,6 +179,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_IGNORE_FAIL_NON_EMPTY) Arg::new(OPT_IGNORE_FAIL_NON_EMPTY)
.long(OPT_IGNORE_FAIL_NON_EMPTY) .long(OPT_IGNORE_FAIL_NON_EMPTY)

View file

@ -2,7 +2,7 @@
use uucore::error::{UResult, UUsageError}; use uucore::error::{UResult, UUsageError};
use clap::{App, Arg}; use clap::{App, AppSettings, Arg};
use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext}; use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext};
use std::borrow::Cow; use std::borrow::Cow;
@ -114,6 +114,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(VERSION) .version(VERSION)
.about(ABOUT) .about(ABOUT)
.after_help(DESCRIPTION) .after_help(DESCRIPTION)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::COMPUTE) Arg::new(options::COMPUTE)
.short('c') .short('c')

View file

@ -147,6 +147,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.setting(AppSettings::TrailingVarArg) .setting(AppSettings::TrailingVarArg)
.setting(AppSettings::AllowHyphenValues) .setting(AppSettings::AllowHyphenValues)
.setting(AppSettings::InferLongArgs)
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.arg( .arg(

View file

@ -8,7 +8,7 @@
// spell-checker:ignore (words) writeback wipesync // spell-checker:ignore (words) writeback wipesync
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use rand::prelude::SliceRandom; use rand::prelude::SliceRandom;
use rand::Rng; use rand::Rng;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
@ -326,6 +326,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::FORCE) Arg::new(options::FORCE)
.long(options::FORCE) .long(options::FORCE)

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) cmdline evec seps rvec fdata // spell-checker:ignore (ToDO) cmdline evec seps rvec fdata
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use rand::Rng; use rand::Rng;
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write};
@ -124,6 +124,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.help_template(TEMPLATE) .help_template(TEMPLATE)
.override_usage(USAGE) .override_usage(USAGE)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::ECHO) Arg::new(options::ECHO)
.short('e') .short('e')

View file

@ -10,7 +10,7 @@ use std::time::Duration;
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
static ABOUT: &str = "Pause for NUMBER seconds."; static ABOUT: &str = "Pause for NUMBER seconds.";
static LONG_HELP: &str = "Pause for NUMBER seconds. SUFFIX may be 's' for seconds (the default), static LONG_HELP: &str = "Pause for NUMBER seconds. SUFFIX may be 's' for seconds (the default),
@ -50,6 +50,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::NUMBER) Arg::new(options::NUMBER)
.help("pause for NUMBER seconds") .help("pause for NUMBER seconds")

View file

@ -25,7 +25,7 @@ mod numeric_str_cmp;
mod tmp_dir; mod tmp_dir;
use chunks::LineData; use chunks::LineData;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use custom_str_cmp::custom_str_cmp; use custom_str_cmp::custom_str_cmp;
use ext_sort::ext_sort; use ext_sort::ext_sort;
use fnv::FnvHasher; use fnv::FnvHasher;
@ -1281,6 +1281,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::modes::SORT) Arg::new(options::modes::SORT)
.long(options::modes::SORT) .long(options::modes::SORT)

View file

@ -11,7 +11,7 @@ mod filenames;
mod platform; mod platform;
use crate::filenames::FilenameFactory; use crate::filenames::FilenameFactory;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use std::convert::TryFrom; use std::convert::TryFrom;
use std::env; use std::env;
use std::fs::remove_file; use std::fs::remove_file;
@ -107,6 +107,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about("Create output files containing consecutive or interleaved sections of input") .about("Create output files containing consecutive or interleaved sections of input")
.setting(AppSettings::InferLongArgs)
// strategy (mutually exclusive) // strategy (mutually exclusive)
.arg( .arg(
Arg::new(OPT_BYTES) Arg::new(OPT_BYTES)

View file

@ -16,7 +16,7 @@ use uucore::fsext::{
}; };
use uucore::libc::mode_t; use uucore::libc::mode_t;
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use std::borrow::Cow; use std::borrow::Cow;
use std::convert::AsRef; use std::convert::AsRef;
use std::os::unix::fs::{FileTypeExt, MetadataExt}; use std::os::unix::fs::{FileTypeExt, MetadataExt};
@ -970,6 +970,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::DEREFERENCE) Arg::new(options::DEREFERENCE)
.short('L') .short('L')

View file

@ -197,6 +197,7 @@ pub fn uu_app<'a>() -> App<'a> {
.about(ABOUT) .about(ABOUT)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.setting(AppSettings::TrailingVarArg) .setting(AppSettings::TrailingVarArg)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::INPUT) Arg::new(options::INPUT)
.long(options::INPUT) .long(options::INPUT)

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::File; use std::fs::File;
use std::io::{stdin, Read}; use std::io::{stdin, Read};
use std::path::Path; use std::path::Path;
@ -146,6 +146,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.override_usage(USAGE) .override_usage(USAGE)
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::FILE) Arg::new(options::FILE)
.multiple_occurrences(true) .multiple_occurrences(true)

View file

@ -9,7 +9,7 @@
extern crate libc; extern crate libc;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::path::Path; use std::path::Path;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
@ -198,6 +198,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::FILE_SYSTEM) Arg::new(options::FILE_SYSTEM)
.short('f') .short('f')

View file

@ -8,7 +8,7 @@
// spell-checker:ignore (ToDO) sbytes slen dlen memmem memmap Mmap mmap SIGBUS // spell-checker:ignore (ToDO) sbytes slen dlen memmem memmap Mmap mmap SIGBUS
mod error; mod error;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use memchr::memmem; use memchr::memmem;
use memmap2::Mmap; use memmap2::Mmap;
use std::io::{stdin, stdout, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufWriter, Read, Write};
@ -66,6 +66,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.override_usage(USAGE) .override_usage(USAGE)
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::BEFORE) Arg::new(options::BEFORE)
.short('b') .short('b')

View file

@ -22,7 +22,7 @@ mod platform;
use chunks::ReverseChunks; use chunks::ReverseChunks;
use lines::lines; use lines::lines;
use clap::{App, Arg}; use clap::{App, AppSettings, Arg};
use std::collections::VecDeque; use std::collections::VecDeque;
use std::ffi::OsString; use std::ffi::OsString;
use std::fmt; use std::fmt;
@ -279,6 +279,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(USAGE) .override_usage(USAGE)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::BYTES) Arg::new(options::BYTES)
.short('c') .short('c')

View file

@ -8,7 +8,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use retain_mut::RetainMut; use retain_mut::RetainMut;
use std::fs::OpenOptions; use std::fs::OpenOptions;
use std::io::{copy, sink, stdin, stdout, Error, ErrorKind, Read, Result, Write}; use std::io::{copy, sink, stdin, stdout, Error, ErrorKind, Read, Result, Write};
@ -64,6 +64,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help("If a FILE is -, it refers to a file named - .") .after_help("If a FILE is -, it refers to a file named - .")
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::APPEND) Arg::new(options::APPEND)
.long(options::APPEND) .long(options::APPEND)

View file

@ -167,6 +167,7 @@ pub fn uu_app<'a>() -> App<'a> {
.multiple_occurrences(true) .multiple_occurrences(true)
) )
.setting(AppSettings::TrailingVarArg) .setting(AppSettings::TrailingVarArg)
.setting(AppSettings::InferLongArgs)
} }
/// Remove pre-existing SIGCHLD handlers that would make waiting for the child's exit code fail. /// Remove pre-existing SIGCHLD handlers that would make waiting for the child's exit code fail.

View file

@ -13,7 +13,7 @@ pub extern crate filetime;
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg, ArgGroup}; use clap::{crate_version, App, AppSettings, Arg, ArgGroup};
use filetime::*; use filetime::*;
use std::fs::{self, File}; use std::fs::{self, File};
use std::path::Path; use std::path::Path;
@ -133,6 +133,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::ACCESS) Arg::new(options::ACCESS)
.short('a') .short('a')
@ -176,7 +177,6 @@ pub fn uu_app<'a>() -> App<'a> {
Arg::new(options::sources::REFERENCE) Arg::new(options::sources::REFERENCE)
.short('r') .short('r')
.long(options::sources::REFERENCE) .long(options::sources::REFERENCE)
.alias("ref") // clapv3
.help("use this file's times instead of the current time") .help("use this file's times instead of the current time")
.value_name("FILE") .value_name("FILE")
.allow_invalid_utf8(true), .allow_invalid_utf8(true),

View file

@ -11,7 +11,7 @@ mod convert;
mod operation; mod operation;
mod unicode_table; mod unicode_table;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use nom::AsBytes; use nom::AsBytes;
use operation::{translate_input, Sequence, SqueezeOperation, TranslateOperation}; use operation::{translate_input, Sequence, SqueezeOperation, TranslateOperation};
use std::io::{stdin, stdout, BufReader, BufWriter}; use std::io::{stdin, stdout, BufReader, BufWriter};
@ -56,7 +56,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
.get_matches_from(args); .get_matches_from(args);
let delete_flag = matches.is_present(options::DELETE); let delete_flag = matches.is_present(options::DELETE);
let complement_flag = matches.is_present(options::COMPLEMENT) || matches.is_present("C"); let complement_flag = matches.is_present(options::COMPLEMENT);
let squeeze_flag = matches.is_present(options::SQUEEZE); let squeeze_flag = matches.is_present(options::SQUEEZE);
let truncate_set1_flag = matches.is_present(options::TRUNCATE_SET1); let truncate_set1_flag = matches.is_present(options::TRUNCATE_SET1);
@ -148,18 +148,15 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::COMPLEMENT) Arg::new(options::COMPLEMENT)
// .visible_short_alias('C') // TODO: requires clap "3.0.0-beta.2" .visible_short_alias('C')
.short('c') .short('c')
.long(options::COMPLEMENT) .long(options::COMPLEMENT)
.help("use the complement of SET1"), .help("use the complement of SET1"),
) )
.arg(
Arg::new("C") // work around for `Arg::visible_short_alias`
.short('C')
.help("same as -c"),
)
.arg( .arg(
Arg::new(options::DELETE) Arg::new(options::DELETE)
.short('d') .short('d')

View file

@ -5,7 +5,7 @@
// * For the full copyright and license information, please view the LICENSE // * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code. // * file that was distributed with this source code.
use clap::App; use clap::{App, AppSettings};
use uucore::error::UResult; use uucore::error::UResult;
#[uucore_procs::gen_uumain] #[uucore_procs::gen_uumain]
@ -15,5 +15,5 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
pub fn uu_app<'a>() -> App<'a> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name()).setting(AppSettings::InferLongArgs)
} }

View file

@ -6,7 +6,7 @@
// * file that was distributed with this source code. // * file that was distributed with this source code.
// spell-checker:ignore (ToDO) RFILE refsize rfilename fsize tsize // spell-checker:ignore (ToDO) RFILE refsize rfilename fsize tsize
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::convert::TryFrom; use std::convert::TryFrom;
use std::fs::{metadata, OpenOptions}; use std::fs::{metadata, OpenOptions};
use std::io::ErrorKind; use std::io::ErrorKind;
@ -117,6 +117,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::IO_BLOCKS) Arg::new(options::IO_BLOCKS)
.short('o') .short('o')

View file

@ -5,7 +5,7 @@
// * // *
// * For the full copyright and license information, please view the LICENSE // * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code. // * file that was distributed with this source code.
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::fs::File; use std::fs::File;
use std::io::{stdin, BufRead, BufReader, Read}; use std::io::{stdin, BufRead, BufReader, Read};
@ -98,6 +98,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.override_usage(USAGE) .override_usage(USAGE)
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg(Arg::new(options::FILE).default_value("-").hide(true)) .arg(Arg::new(options::FILE).default_value("-").hide(true))
} }

View file

@ -9,7 +9,7 @@
// spell-checker:ignore (ToDO) ttyname filedesc // spell-checker:ignore (ToDO) ttyname filedesc
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::ffi::CStr; use std::ffi::CStr;
use std::io::Write; use std::io::Write;
use uucore::error::{UResult, UUsageError}; use uucore::error::{UResult, UUsageError};
@ -75,6 +75,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::SILENT) Arg::new(options::SILENT)
.long(options::SILENT) .long(options::SILENT)

View file

@ -10,7 +10,7 @@
// spell-checker:ignore (ToDO) nodename kernelname kernelrelease kernelversion sysname hwplatform mnrsv // spell-checker:ignore (ToDO) nodename kernelname kernelrelease kernelversion sysname hwplatform mnrsv
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use platform_info::*; use platform_info::*;
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -122,6 +122,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg(Arg::new(options::ALL) .arg(Arg::new(options::ALL)
.short('a') .short('a')
.long(options::ALL) .long(options::ALL)

View file

@ -11,7 +11,7 @@
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Stdout, Write}; use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Stdout, Write};
use std::str::from_utf8; use std::str::from_utf8;
@ -108,6 +108,7 @@ pub fn uu_app<'a>() -> App<'a> {
.version(crate_version!()) .version(crate_version!())
.override_usage(USAGE) .override_usage(USAGE)
.about(SUMMARY) .about(SUMMARY)
.setting(AppSettings::InferLongArgs)
.arg(Arg::new(options::FILE).hide(true).multiple_occurrences(true)) .arg(Arg::new(options::FILE).hide(true).multiple_occurrences(true))
.arg( .arg(
Arg::new(options::ALL) Arg::new(options::ALL)

View file

@ -5,7 +5,7 @@
// * For the full copyright and license information, please view the LICENSE // * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code. // * file that was distributed with this source code.
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use std::fs::File; use std::fs::File;
use std::io::{self, stdin, stdout, BufRead, BufReader, BufWriter, Read, Write}; use std::io::{self, stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
use std::path::Path; use std::path::Path;
@ -303,6 +303,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::ALL_REPEATED) Arg::new(options::ALL_REPEATED)
.short('D') .short('D')

View file

@ -10,7 +10,7 @@
use std::fs::remove_file; use std::fs::remove_file;
use std::path::Path; use std::path::Path;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -31,6 +31,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(OPT_PATH) Arg::new(OPT_PATH)
.required(true) .required(true)

View file

@ -9,7 +9,7 @@
// spell-checker:ignore (ToDO) getloadavg upsecs updays nusers loadavg boottime uphours upmins // spell-checker:ignore (ToDO) getloadavg upsecs updays nusers loadavg boottime uphours upmins
use chrono::{Local, TimeZone, Utc}; use chrono::{Local, TimeZone, Utc};
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
// import crate time from utmpx // import crate time from utmpx
pub use uucore::libc; pub use uucore::libc;
@ -66,6 +66,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::SINCE) Arg::new(options::SINCE)
.short('s') .short('s')

View file

@ -10,7 +10,7 @@
use std::path::Path; use std::path::Path;
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use uucore::error::UResult; use uucore::error::UResult;
use uucore::utmpx::{self, Utmpx}; use uucore::utmpx::{self, Utmpx};
@ -68,5 +68,6 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg(Arg::new(ARG_FILES).takes_value(true).max_values(1)) .arg(Arg::new(ARG_FILES).takes_value(true).max_values(1))
} }

View file

@ -17,7 +17,7 @@ use unicode_width::UnicodeWidthChar;
use utf8::{BufReadDecoder, BufReadDecoderError}; use utf8::{BufReadDecoder, BufReadDecoderError};
use word_count::{TitledWordCount, WordCount}; use word_count::{TitledWordCount, WordCount};
use clap::{crate_version, App, Arg, ArgMatches}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use std::cmp::max; use std::cmp::max;
use std::fs::{self, File}; use std::fs::{self, File};
@ -166,6 +166,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::BYTES) Arg::new(options::BYTES)
.short('c') .short('c')

View file

@ -12,7 +12,7 @@ use uucore::error::{FromIo, UResult};
use uucore::libc::{ttyname, STDIN_FILENO, S_IWGRP}; use uucore::libc::{ttyname, STDIN_FILENO, S_IWGRP};
use uucore::utmpx::{self, time, Utmpx}; use uucore::utmpx::{self, time, Utmpx};
use clap::{crate_version, App, Arg}; use clap::{crate_version, App, AppSettings, Arg};
use std::borrow::Cow; use std::borrow::Cow;
use std::ffi::CStr; use std::ffi::CStr;
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
@ -165,6 +165,7 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
.arg( .arg(
Arg::new(options::ALL) Arg::new(options::ALL)
.long(options::ALL) .long(options::ALL)

View file

@ -10,7 +10,7 @@
#[macro_use] #[macro_use]
extern crate clap; extern crate clap;
use clap::App; use clap::{App, AppSettings};
use uucore::display::println_verbatim; use uucore::display::println_verbatim;
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -31,4 +31,5 @@ pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.setting(AppSettings::InferLongArgs)
} }

View file

@ -13,7 +13,7 @@ use std::io::{self, Write};
#[macro_use] #[macro_use]
extern crate clap; extern crate clap;
use clap::{App, Arg}; use clap::{App, AppSettings, Arg};
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
#[cfg(any(target_os = "linux", target_os = "android"))] #[cfg(any(target_os = "linux", target_os = "android"))]
@ -47,7 +47,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
pub fn uu_app<'a>() -> App<'a> { pub fn uu_app<'a>() -> App<'a> {
app_from_crate!().arg(Arg::new("STRING").index(1).multiple_occurrences(true)) app_from_crate!()
.arg(Arg::new("STRING").index(1).multiple_occurrences(true))
.setting(AppSettings::InferLongArgs)
} }
fn prepare_buffer<'a>(input: &'a str, buffer: &'a mut [u8; BUF_SIZE]) -> &'a [u8] { fn prepare_buffer<'a>(input: &'a str, buffer: &'a mut [u8; BUF_SIZE]) -> &'a [u8] {