mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #4415 from papparapa/nohup-move-help-strings-to-md-file
nohup: move help strings to markdown file
This commit is contained in:
commit
ea2100a64a
2 changed files with 20 additions and 12 deletions
15
src/uu/nohup/nohup.md
Normal file
15
src/uu/nohup/nohup.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# nohup
|
||||||
|
|
||||||
|
```
|
||||||
|
nohup COMMAND [ARG]...
|
||||||
|
nohup FLAG
|
||||||
|
```
|
||||||
|
|
||||||
|
Run COMMAND ignoring hangup signals.
|
||||||
|
|
||||||
|
## After Help
|
||||||
|
|
||||||
|
If standard input is terminal, it'll be replaced with /dev/null.
|
||||||
|
If standard output is terminal, it'll be appended to nohup.out instead,
|
||||||
|
or $HOME/nohup.out, if nohup.out open failed.
|
||||||
|
If standard error is terminal, it'll be redirected to stdout.
|
|
@ -20,18 +20,11 @@ use std::os::unix::prelude::*;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
use uucore::error::{set_exit_code, UClapError, UError, UResult};
|
use uucore::error::{set_exit_code, UClapError, UError, UResult};
|
||||||
use uucore::{format_usage, show_error};
|
use uucore::{format_usage, help_about, help_section, help_usage, show_error};
|
||||||
|
|
||||||
static ABOUT: &str = "Run COMMAND ignoring hangup signals.";
|
const ABOUT: &str = help_about!("nohup.md");
|
||||||
static LONG_HELP: &str = "
|
const AFTER_HELP: &str = help_section!("after help", "nohup.md");
|
||||||
If standard input is terminal, it'll be replaced with /dev/null.
|
const USAGE: &str = help_usage!("nohup.md");
|
||||||
If standard output is terminal, it'll be appended to nohup.out instead,
|
|
||||||
or $HOME/nohup.out, if nohup.out open failed.
|
|
||||||
If standard error is terminal, it'll be redirected to stdout.
|
|
||||||
";
|
|
||||||
const USAGE: &str = "\
|
|
||||||
{} COMMAND [ARG]...
|
|
||||||
{} FLAG";
|
|
||||||
static NOHUP_OUT: &str = "nohup.out";
|
static NOHUP_OUT: &str = "nohup.out";
|
||||||
// exit codes that match the GNU implementation
|
// exit codes that match the GNU implementation
|
||||||
static EXIT_CANCELED: i32 = 125;
|
static EXIT_CANCELED: i32 = 125;
|
||||||
|
@ -116,7 +109,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))
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::CMD)
|
Arg::new(options::CMD)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue