1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

dircolors: move help strings to markdown file

This commit is contained in:
Koki Ueha 2023-02-25 10:46:19 +00:00
parent 44ef16fa25
commit ba4a9a05a1
2 changed files with 18 additions and 8 deletions

View 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'

View file

@ -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(