mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
Merge pull request #4579 from piotrkwiecinski/nproc-move-string-to-md-file
nproc: move help strings to markdown file
This commit is contained in:
commit
c2f2301067
2 changed files with 12 additions and 5 deletions
9
src/uu/nproc/nproc.md
Normal file
9
src/uu/nproc/nproc.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# nproc
|
||||||
|
|
||||||
|
```
|
||||||
|
nproc [OPTIONS]...
|
||||||
|
```
|
||||||
|
|
||||||
|
Print the number of cores available to the current process.
|
||||||
|
If the `OMP_NUM_THREADS` or `OMP_THREAD_LIMIT` environment variables are set, then
|
||||||
|
they will determine the minimum and maximum returned value respectively.
|
|
@ -11,7 +11,7 @@ use clap::{crate_version, Arg, ArgAction, Command};
|
||||||
use std::{env, thread};
|
use std::{env, thread};
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
use uucore::error::{UResult, USimpleError};
|
use uucore::error::{UResult, USimpleError};
|
||||||
use uucore::format_usage;
|
use uucore::{format_usage, help_about, help_usage};
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
pub const _SC_NPROCESSORS_CONF: libc::c_int = 83;
|
pub const _SC_NPROCESSORS_CONF: libc::c_int = 83;
|
||||||
|
@ -25,10 +25,8 @@ pub const _SC_NPROCESSORS_CONF: libc::c_int = 1001;
|
||||||
static OPT_ALL: &str = "all";
|
static OPT_ALL: &str = "all";
|
||||||
static OPT_IGNORE: &str = "ignore";
|
static OPT_IGNORE: &str = "ignore";
|
||||||
|
|
||||||
static ABOUT: &str = r#"Print the number of cores available to the current process.
|
const ABOUT: &str = help_about!("nproc.md");
|
||||||
If the OMP_NUM_THREADS or OMP_THREAD_LIMIT environment variables are set, then
|
const USAGE: &str = help_usage!("nproc.md");
|
||||||
they will determine the minimum and maximum returned value respectively."#;
|
|
||||||
const USAGE: &str = "{} [OPTIONS]...";
|
|
||||||
|
|
||||||
#[uucore::main]
|
#[uucore::main]
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue