mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
Merge pull request #4562 from miles170/factor-move-help-strings-to-md-file
factor: move help strings to markdown file
This commit is contained in:
commit
2a92e434c1
2 changed files with 12 additions and 3 deletions
8
src/uu/factor/factor.md
Normal file
8
src/uu/factor/factor.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# factor
|
||||||
|
|
||||||
|
```
|
||||||
|
factor [NUMBER]...
|
||||||
|
```
|
||||||
|
|
||||||
|
Print the prime factors of the given NUMBER(s).
|
||||||
|
If none are specified, read from standard input.
|
|
@ -16,15 +16,15 @@ use clap::{crate_version, Arg, ArgAction, Command};
|
||||||
pub use factor::*;
|
pub use factor::*;
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
use uucore::error::UResult;
|
use uucore::error::UResult;
|
||||||
use uucore::{show_error, show_warning};
|
use uucore::{format_usage, help_about, help_usage, show_error, show_warning};
|
||||||
|
|
||||||
mod miller_rabin;
|
mod miller_rabin;
|
||||||
pub mod numeric;
|
pub mod numeric;
|
||||||
mod rho;
|
mod rho;
|
||||||
pub mod table;
|
pub mod table;
|
||||||
|
|
||||||
static ABOUT: &str = r#"Print the prime factors of the given NUMBER(s).
|
const ABOUT: &str = help_about!("factor.md");
|
||||||
If none are specified, read from standard input."#;
|
const USAGE: &str = help_usage!("factor.md");
|
||||||
|
|
||||||
mod options {
|
mod options {
|
||||||
pub static NUMBER: &str = "NUMBER";
|
pub static NUMBER: &str = "NUMBER";
|
||||||
|
@ -84,6 +84,7 @@ pub fn uu_app() -> Command {
|
||||||
Command::new(uucore::util_name())
|
Command::new(uucore::util_name())
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.about(ABOUT)
|
.about(ABOUT)
|
||||||
|
.override_usage(format_usage(USAGE))
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
.arg(Arg::new(options::NUMBER).action(ArgAction::Append))
|
.arg(Arg::new(options::NUMBER).action(ArgAction::Append))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue