1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #4591 from piotrkwiecinski/nice-move-string-to-md-file

nice: move help strings to markdown file
This commit is contained in:
Daniel Hofstetter 2023-03-24 07:06:13 +01:00 committed by GitHub
commit e03ed21e10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

10
src/uu/nice/nice.md Normal file
View file

@ -0,0 +1,10 @@
# nice
```
nice [OPTIONS] [COMMAND [ARGS]]
```
Run `COMMAND` with an adjusted niceness, which affects process scheduling.
With no `COMMAND`, print the current niceness. Niceness values range from at
least -20 (most favorable to the process) to 19 (least favorable to the
process).

View file

@ -15,7 +15,7 @@ use std::ptr;
use clap::{crate_version, Arg, ArgAction, Command};
use uucore::{
error::{set_exit_code, UClapError, UResult, USimpleError, UUsageError},
format_usage, show_error,
format_usage, help_about, help_usage, show_error,
};
pub mod options {
@ -23,12 +23,8 @@ pub mod options {
pub static COMMAND: &str = "COMMAND";
}
const ABOUT: &str = "\
Run COMMAND with an adjusted niceness, which affects process scheduling. \
With no COMMAND, print the current niceness. Niceness values range from at \
least -20 (most favorable to the process) to 19 (least favorable to the \
process).";
const USAGE: &str = "{} [OPTIONS] [COMMAND [ARGS]]";
const ABOUT: &str = help_about!("nice.md");
const USAGE: &str = help_usage!("nice.md");
fn is_prefix_of(maybe_prefix: &str, target: &str, min_match: usize) -> bool {
if maybe_prefix.len() < min_match || maybe_prefix.len() > target.len() {