mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Merge pull request #4435 from papparapa/dircolors-move-help-strings-to-md-file
dircolors: move help strings to markdown file
This commit is contained in:
commit
5e851d4bde
2 changed files with 18 additions and 8 deletions
13
src/uu/dircolors/dircolors.md
Normal file
13
src/uu/dircolors/dircolors.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# dircolors
|
||||||
|
|
||||||
|
```
|
||||||
|
dircolors [OPTION]... [FILE]
|
||||||
|
```
|
||||||
|
|
||||||
|
Output commands to set the LS_COLORS environment variable.
|
||||||
|
|
||||||
|
## After Help
|
||||||
|
|
||||||
|
If FILE is specified, read it to determine which colors to use for which
|
||||||
|
file types and extensions. Otherwise, a precompiled database is used.
|
||||||
|
For details on the format of these files, run 'dircolors --print-database'
|
|
@ -16,6 +16,7 @@ use std::io::{BufRead, BufReader};
|
||||||
use clap::{crate_version, Arg, ArgAction, Command};
|
use clap::{crate_version, Arg, ArgAction, Command};
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
use uucore::error::{UResult, USimpleError, UUsageError};
|
use uucore::error::{UResult, USimpleError, UUsageError};
|
||||||
|
use uucore::{help_about, help_section, help_usage};
|
||||||
|
|
||||||
mod options {
|
mod options {
|
||||||
pub const BOURNE_SHELL: &str = "bourne-shell";
|
pub const BOURNE_SHELL: &str = "bourne-shell";
|
||||||
|
@ -25,13 +26,9 @@ mod options {
|
||||||
pub const FILE: &str = "FILE";
|
pub const FILE: &str = "FILE";
|
||||||
}
|
}
|
||||||
|
|
||||||
static USAGE: &str = "{} [OPTION]... [FILE]";
|
const USAGE: &str = help_usage!("dircolors.md");
|
||||||
static ABOUT: &str = "Output commands to set the LS_COLORS environment variable.";
|
const ABOUT: &str = help_about!("dircolors.md");
|
||||||
static LONG_HELP: &str = "
|
const AFTER_HELP: &str = help_section!("after help", "dircolors.md");
|
||||||
If FILE is specified, read it to determine which colors to use for which
|
|
||||||
file types and extensions. Otherwise, a precompiled database is used.
|
|
||||||
For details on the format of these files, run 'dircolors --print-database'
|
|
||||||
";
|
|
||||||
|
|
||||||
mod colors;
|
mod colors;
|
||||||
use self::colors::INTERNAL_DB;
|
use self::colors::INTERNAL_DB;
|
||||||
|
@ -170,7 +167,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)
|
||||||
.after_help(LONG_HELP)
|
.after_help(AFTER_HELP)
|
||||||
.override_usage(format_usage(USAGE))
|
.override_usage(format_usage(USAGE))
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue