mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-04 15:07:47 +00:00
refactor/polish ~ fix cargo clippy
complaints ('better' as println!()
)
This commit is contained in:
parent
291d2f5d48
commit
413c64fa12
27 changed files with 58 additions and 59 deletions
|
@ -80,7 +80,7 @@ fn maybe_handle_help_or_version(args: &[String]) -> bool {
|
||||||
|
|
||||||
fn print_help() {
|
fn print_help() {
|
||||||
//! The following is taken from GNU coreutils' "expr --help" output.
|
//! The following is taken from GNU coreutils' "expr --help" output.
|
||||||
print!(
|
println!(
|
||||||
r#"Usage: expr EXPRESSION
|
r#"Usage: expr EXPRESSION
|
||||||
or: expr OPTION
|
or: expr OPTION
|
||||||
|
|
||||||
|
@ -131,8 +131,7 @@ Environment variables:
|
||||||
* EXPR_DEBUG_TOKENS=1 dump expression's tokens
|
* EXPR_DEBUG_TOKENS=1 dump expression's tokens
|
||||||
* EXPR_DEBUG_RPN=1 dump expression represented in reverse polish notation
|
* EXPR_DEBUG_RPN=1 dump expression represented in reverse polish notation
|
||||||
* EXPR_DEBUG_SYA_STEP=1 dump each parser step
|
* EXPR_DEBUG_SYA_STEP=1 dump each parser step
|
||||||
* EXPR_DEBUG_AST=1 dump expression represented abstract syntax tree
|
* EXPR_DEBUG_AST=1 dump expression represented abstract syntax tree"#
|
||||||
"#
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ fn table() {
|
||||||
//TODO: obtain max signal width here
|
//TODO: obtain max signal width here
|
||||||
|
|
||||||
if (idx + 1) % 7 == 0 {
|
if (idx + 1) % 7 == 0 {
|
||||||
println!("");
|
println!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ fn print_signals() {
|
||||||
pos += signal.name.len();
|
pos += signal.name.len();
|
||||||
print!("{}", signal.name);
|
print!("{}", signal.name);
|
||||||
if idx > 0 && pos > 73 {
|
if idx > 0 && pos > 73 {
|
||||||
println!("");
|
println!();
|
||||||
pos = 0;
|
pos = 0;
|
||||||
} else {
|
} else {
|
||||||
pos += 1;
|
pos += 1;
|
||||||
|
|
|
@ -295,7 +295,7 @@ fn link(src: &PathBuf, dst: &PathBuf, settings: &Settings) -> Result<()> {
|
||||||
print!("'{}' -> '{}'", dst.display(), src.display());
|
print!("'{}' -> '{}'", dst.display(), src.display());
|
||||||
match backup_path {
|
match backup_path {
|
||||||
Some(path) => println!(" (backup: '{}')", path.display()),
|
Some(path) => println!(" (backup: '{}')", path.display()),
|
||||||
None => println!(""),
|
None => println!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -76,7 +76,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
fn print_help(opts: &getopts::Options) {
|
fn print_help(opts: &getopts::Options) {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
print!(
|
print!(
|
||||||
"{}",
|
"{}",
|
||||||
|
|
|
@ -164,5 +164,5 @@ fn more(matches: getopts::Matches) {
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_term(&mut term);
|
reset_term(&mut term);
|
||||||
println!("");
|
println!();
|
||||||
}
|
}
|
||||||
|
|
|
@ -387,7 +387,7 @@ fn rename(from: &PathBuf, to: &PathBuf, b: &Behaviour) -> Result<()> {
|
||||||
print!("‘{}’ -> ‘{}’", from.display(), to.display());
|
print!("‘{}’ -> ‘{}’", from.display(), to.display());
|
||||||
match backup_path {
|
match backup_path {
|
||||||
Some(path) => println!(" (backup: ‘{}’)", path.display()),
|
Some(path) => println!(" (backup: ‘{}’)", path.display()),
|
||||||
None => println!(""),
|
None => println!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -272,7 +272,7 @@ fn nl<T: Read>(reader: &mut BufReader<T>, settings: &Settings) {
|
||||||
if matched_groups > 0 {
|
if matched_groups > 0 {
|
||||||
// The current line is a section delimiter, so we output
|
// The current line is a section delimiter, so we output
|
||||||
// a blank line.
|
// a blank line.
|
||||||
println!("");
|
println!();
|
||||||
// However the line does not count as a blank line, so we
|
// However the line does not count as a blank line, so we
|
||||||
// reset the counter used for --join-blank-lines.
|
// reset the counter used for --join-blank-lines.
|
||||||
empty_line_count = 0;
|
empty_line_count = 0;
|
||||||
|
|
|
@ -315,10 +315,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
let matches = opts.parse(&args[1..]).unwrap();
|
let matches = opts.parse(&args[1..]).unwrap();
|
||||||
if matches.opt_present("help") {
|
if matches.opt_present("help") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {0} [STRING]... [OPTION]...", NAME);
|
println!(" {0} [STRING]... [OPTION]...", NAME);
|
||||||
println!("");
|
println!();
|
||||||
print!(
|
print!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage("Convert numbers from/to human-readable strings")
|
opts.usage("Convert numbers from/to human-readable strings")
|
||||||
|
|
|
@ -263,7 +263,7 @@ impl Pinky {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("");
|
println!();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_heading(&self) {
|
fn print_heading(&self) {
|
||||||
|
@ -279,7 +279,7 @@ impl Pinky {
|
||||||
if self.include_where {
|
if self.include_where {
|
||||||
print!(" Where");
|
print!(" Where");
|
||||||
}
|
}
|
||||||
println!("");
|
println!();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn short_pinky(&self) -> IOResult<()> {
|
fn short_pinky(&self) -> IOResult<()> {
|
||||||
|
@ -325,7 +325,7 @@ impl Pinky {
|
||||||
read_to_console(f);
|
read_to_console(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println!("");
|
println!();
|
||||||
} else {
|
} else {
|
||||||
println!(" ???");
|
println!(" ???");
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ fn show(path: &PathBuf, no_newline: bool, use_zero: bool) {
|
||||||
|
|
||||||
fn show_usage(opts: &getopts::Options) {
|
fn show_usage(opts: &getopts::Options) {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage: {0} [OPTION]... [FILE]...", NAME);
|
println!("Usage: {0} [OPTION]... [FILE]...", NAME);
|
||||||
print!("Print value of a symbolic link or canonical file name");
|
print!("Print value of a symbolic link or canonical file name");
|
||||||
print!("{}", opts.usage(""));
|
print!("{}", opts.usage(""));
|
||||||
|
|
|
@ -136,12 +136,12 @@ fn version() {
|
||||||
|
|
||||||
fn show_usage(opts: &getopts::Options) {
|
fn show_usage(opts: &getopts::Options) {
|
||||||
version();
|
version();
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [-s|--strip] [-z|--zero] FILENAME...", NAME);
|
println!(" {} [-s|--strip] [-z|--zero] FILENAME...", NAME);
|
||||||
println!(" {} -V|--version", NAME);
|
println!(" {} -V|--version", NAME);
|
||||||
println!(" {} -h|--help", NAME);
|
println!(" {} -h|--help", NAME);
|
||||||
println!("");
|
println!();
|
||||||
print!("{}", opts.usage(
|
print!("{}", opts.usage(
|
||||||
"Convert each FILENAME to the absolute path.\n\
|
"Convert each FILENAME to the absolute path.\n\
|
||||||
All the symbolic links will be resolved, resulting path will contain no special components like '.' or '..'.\n\
|
All the symbolic links will be resolved, resulting path will contain no special components like '.' or '..'.\n\
|
||||||
|
|
|
@ -108,12 +108,12 @@ fn version() {
|
||||||
|
|
||||||
fn show_usage(opts: &getopts::Options) {
|
fn show_usage(opts: &getopts::Options) {
|
||||||
version();
|
version();
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [-d DIR] TO [FROM]", NAME);
|
println!(" {} [-d DIR] TO [FROM]", NAME);
|
||||||
println!(" {} -V|--version", NAME);
|
println!(" {} -V|--version", NAME);
|
||||||
println!(" {} -h|--help", NAME);
|
println!(" {} -h|--help", NAME);
|
||||||
println!("");
|
println!();
|
||||||
print!(
|
print!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage(
|
opts.usage(
|
||||||
|
|
10
src/rm/rm.rs
10
src/rm/rm.rs
|
@ -84,20 +84,20 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("help") {
|
if matches.opt_present("help") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {0} [OPTION]... [FILE]...", NAME);
|
println!(" {0} [OPTION]... [FILE]...", NAME);
|
||||||
println!("");
|
println!();
|
||||||
println!("{}", opts.usage("Remove (unlink) the FILE(s)."));
|
println!("{}", opts.usage("Remove (unlink) the FILE(s)."));
|
||||||
println!("By default, rm does not remove directories. Use the --recursive (-r)");
|
println!("By default, rm does not remove directories. Use the --recursive (-r)");
|
||||||
println!("option to remove each listed directory, too, along with all of its contents");
|
println!("option to remove each listed directory, too, along with all of its contents");
|
||||||
println!("");
|
println!();
|
||||||
println!("To remove a file whose name starts with a '-', for example '-foo',");
|
println!("To remove a file whose name starts with a '-', for example '-foo',");
|
||||||
println!("use one of these commands:");
|
println!("use one of these commands:");
|
||||||
println!("rm -- -foo");
|
println!("rm -- -foo");
|
||||||
println!("");
|
println!();
|
||||||
println!("rm ./-foo");
|
println!("rm ./-foo");
|
||||||
println!("");
|
println!();
|
||||||
println!("Note that if you use rm to remove a file, it might be possible to recover");
|
println!("Note that if you use rm to remove a file, it might be possible to recover");
|
||||||
println!("some of its contents, given sufficient expertise and/or time. For greater");
|
println!("some of its contents, given sufficient expertise and/or time. For greater");
|
||||||
println!("assurance that the contents are truly unrecoverable, consider using shred.");
|
println!("assurance that the contents are truly unrecoverable, consider using shred.");
|
||||||
|
|
|
@ -290,7 +290,7 @@ fn show_help(opts: &getopts::Options) {
|
||||||
println!("Delete FILE(s) if --remove (-u) is specified. The default is not to remove");
|
println!("Delete FILE(s) if --remove (-u) is specified. The default is not to remove");
|
||||||
println!("the files because it is common to operate on device files like /dev/hda,");
|
println!("the files because it is common to operate on device files like /dev/hda,");
|
||||||
println!("and those files usually should not be removed.");
|
println!("and those files usually should not be removed.");
|
||||||
println!("");
|
println!();
|
||||||
println!(
|
println!(
|
||||||
"CAUTION: Note that {} relies on a very important assumption:",
|
"CAUTION: Note that {} relies on a very important assumption:",
|
||||||
NAME
|
NAME
|
||||||
|
@ -302,20 +302,20 @@ fn show_help(opts: &getopts::Options) {
|
||||||
NAME
|
NAME
|
||||||
);
|
);
|
||||||
println!("not effective, or is not guaranteed to be effective in all file system modes:");
|
println!("not effective, or is not guaranteed to be effective in all file system modes:");
|
||||||
println!("");
|
println!();
|
||||||
println!("* log-structured or journaled file systems, such as those supplied with");
|
println!("* log-structured or journaled file systems, such as those supplied with");
|
||||||
println!("AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)");
|
println!("AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)");
|
||||||
println!("");
|
println!();
|
||||||
println!("* file systems that write redundant data and carry on even if some writes");
|
println!("* file systems that write redundant data and carry on even if some writes");
|
||||||
println!("fail, such as RAID-based file systems");
|
println!("fail, such as RAID-based file systems");
|
||||||
println!("");
|
println!();
|
||||||
println!("* file systems that make snapshots, such as Network Appliance's NFS server");
|
println!("* file systems that make snapshots, such as Network Appliance's NFS server");
|
||||||
println!("");
|
println!();
|
||||||
println!("* file systems that cache in temporary locations, such as NFS");
|
println!("* file systems that cache in temporary locations, such as NFS");
|
||||||
println!("version 3 clients");
|
println!("version 3 clients");
|
||||||
println!("");
|
println!();
|
||||||
println!("* compressed file systems");
|
println!("* compressed file systems");
|
||||||
println!("");
|
println!();
|
||||||
println!("In the case of ext3 file systems, the above disclaimer applies");
|
println!("In the case of ext3 file systems, the above disclaimer applies");
|
||||||
println!(
|
println!(
|
||||||
"(and {} is thus of limited effectiveness) only in data=journal mode,",
|
"(and {} is thus of limited effectiveness) only in data=journal mode,",
|
||||||
|
@ -329,7 +329,7 @@ fn show_help(opts: &getopts::Options) {
|
||||||
println!("Ext3 journaling modes can be changed by adding the data=something option");
|
println!("Ext3 journaling modes can be changed by adding the data=something option");
|
||||||
println!("to the mount options for a particular file system in the /etc/fstab file,");
|
println!("to the mount options for a particular file system in the /etc/fstab file,");
|
||||||
println!("as documented in the mount man page (man mount).");
|
println!("as documented in the mount man page (man mount).");
|
||||||
println!("");
|
println!();
|
||||||
println!("In addition, file system backups and remote mirrors may contain copies");
|
println!("In addition, file system backups and remote mirrors may contain copies");
|
||||||
println!("of the file that cannot be removed, and that will allow a shredded file");
|
println!("of the file that cannot be removed, and that will allow a shredded file");
|
||||||
println!("to be recovered later.");
|
println!("to be recovered later.");
|
||||||
|
|
|
@ -86,9 +86,9 @@ fn print_usage(opts: &Options) {
|
||||||
Also some filters (like 'dd' and 'cat' etc.) don't use streams for I/O, \
|
Also some filters (like 'dd' and 'cat' etc.) don't use streams for I/O, \
|
||||||
and are thus unaffected by 'stdbuf' settings.\n";
|
and are thus unaffected by 'stdbuf' settings.\n";
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage: stdbuf OPTION... COMMAND");
|
println!("Usage: stdbuf OPTION... COMMAND");
|
||||||
println!("");
|
println!();
|
||||||
println!("{}\n{}", opts.usage(brief), explanation);
|
println!("{}\n{}", opts.usage(brief), explanation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
fn version() {
|
fn version() {
|
||||||
println!("{} (uutils) {}", NAME, VERSION);
|
println!("{} (uutils) {}", NAME, VERSION);
|
||||||
println!("The MIT License");
|
println!("The MIT License");
|
||||||
println!("");
|
println!();
|
||||||
println!("Author -- Alexander Fomin.");
|
println!("Author -- Alexander Fomin.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,9 +95,9 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("help") || matches.free.is_empty() {
|
if matches.opt_present("help") || matches.free.is_empty() {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage: {} [OPTION]... FILE...", NAME);
|
println!("Usage: {} [OPTION]... FILE...", NAME);
|
||||||
println!("");
|
println!();
|
||||||
println!(
|
println!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage(
|
opts.usage(
|
||||||
|
|
|
@ -178,10 +178,10 @@ fn translate_input<T: SymbolTranslator>(
|
||||||
|
|
||||||
fn usage(opts: &Options) {
|
fn usage(opts: &Options) {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [OPTIONS] SET1 [SET2]", NAME);
|
println!(" {} [OPTIONS] SET1 [SET2]", NAME);
|
||||||
println!("");
|
println!();
|
||||||
println!("{}", opts.usage("Translate or delete characters."));
|
println!("{}", opts.usage("Translate or delete characters."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("help") {
|
if matches.opt_present("help") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [OPTION]... FILE...", NAME);
|
println!(" {} [OPTION]... FILE...", NAME);
|
||||||
println!("");
|
println!();
|
||||||
print!(
|
print!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage("Shrink or extend the size of each file to the specified size.")
|
opts.usage("Shrink or extend the size of each file to the specified size.")
|
||||||
|
|
|
@ -36,10 +36,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("h") {
|
if matches.opt_present("h") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [OPTIONS] FILE", NAME);
|
println!(" {} [OPTIONS] FILE", NAME);
|
||||||
println!("");
|
println!();
|
||||||
println!("{}", opts.usage("Topological sort the strings in FILE. Strings are defined as any sequence of tokens separated by whitespace (tab, space, or newline). If FILE is not passed in, stdin is used instead."));
|
println!("{}", opts.usage("Topological sort the strings in FILE. Strings are defined as any sequence of tokens separated by whitespace (tab, space, or newline). If FILE is not passed in, stdin is used instead."));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("help") {
|
if matches.opt_present("help") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [OPTION]...", NAME);
|
println!(" {} [OPTION]...", NAME);
|
||||||
println!("");
|
println!();
|
||||||
print!(
|
print!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage("Print the file name of the terminal connected to standard input.")
|
opts.usage("Print the file name of the terminal connected to standard input.")
|
||||||
|
|
|
@ -252,10 +252,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("help") {
|
if matches.opt_present("help") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {0} [OPTION]... [FILE]...", NAME);
|
println!(" {0} [OPTION]... [FILE]...", NAME);
|
||||||
println!("");
|
println!();
|
||||||
print!(
|
print!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage(
|
opts.usage(
|
||||||
|
@ -263,7 +263,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
writing to OUTPUT (or standard output)."
|
writing to OUTPUT (or standard output)."
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
println!("");
|
println!();
|
||||||
println!(
|
println!(
|
||||||
"Note: '{0}' does not detect repeated lines unless they are adjacent.\n\
|
"Note: '{0}' does not detect repeated lines unless they are adjacent.\n\
|
||||||
You may want to sort the input first, or use 'sort -u' without '{0}'.\n",
|
You may want to sort the input first, or use 'sort -u' without '{0}'.\n",
|
||||||
|
|
|
@ -40,10 +40,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("help") {
|
if matches.opt_present("help") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [FILE]... [OPTION]...", NAME);
|
println!(" {} [FILE]... [OPTION]...", NAME);
|
||||||
println!("");
|
println!();
|
||||||
println!("{}", opts.usage("Unlink the file at [FILE]."));
|
println!("{}", opts.usage("Unlink the file at [FILE]."));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
}
|
}
|
||||||
if matches.opt_present("help") || !matches.free.is_empty() {
|
if matches.opt_present("help") || !matches.free.is_empty() {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {0} [OPTION]", NAME);
|
println!(" {0} [OPTION]", NAME);
|
||||||
println!("");
|
println!();
|
||||||
println!(
|
println!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage(
|
opts.usage(
|
||||||
|
|
|
@ -37,10 +37,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("help") {
|
if matches.opt_present("help") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [OPTION]... [FILE]", NAME);
|
println!(" {} [OPTION]... [FILE]", NAME);
|
||||||
println!("");
|
println!();
|
||||||
println!(
|
println!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage("Output who is currently logged in according to FILE.")
|
opts.usage("Output who is currently logged in according to FILE.")
|
||||||
|
|
|
@ -24,7 +24,7 @@ include!(concat!(env!("OUT_DIR"), "/uutils_map.rs"));
|
||||||
|
|
||||||
fn usage(cmap: &UtilityMap) {
|
fn usage(cmap: &UtilityMap) {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {} [util [arguments...]]\n", NAME);
|
println!(" {} [util [arguments...]]\n", NAME);
|
||||||
println!("Currently defined functions:");
|
println!("Currently defined functions:");
|
||||||
|
|
|
@ -90,10 +90,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
if matches.opt_present("help") {
|
if matches.opt_present("help") {
|
||||||
println!("{} {}", NAME, VERSION);
|
println!("{} {}", NAME, VERSION);
|
||||||
println!("");
|
println!();
|
||||||
println!("Usage:");
|
println!("Usage:");
|
||||||
println!(" {0} [OPTION]... [FILE]...", NAME);
|
println!(" {0} [OPTION]... [FILE]...", NAME);
|
||||||
println!("");
|
println!();
|
||||||
println!(
|
println!(
|
||||||
"{}",
|
"{}",
|
||||||
opts.usage("Print newline, word and byte counts for each FILE")
|
opts.usage("Print newline, word and byte counts for each FILE")
|
||||||
|
@ -254,7 +254,7 @@ fn print_stats(settings: &Settings, result: &Result, max_width: usize) {
|
||||||
if result.title != "-" {
|
if result.title != "-" {
|
||||||
println!(" {}", result.title);
|
println!(" {}", result.title);
|
||||||
} else {
|
} else {
|
||||||
println!("");
|
println!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue