Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

join: move help strings to markdown file #4583

Merged
merged 2 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/uu/join/join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# join

```
join [OPTIONS] <FILE1> <FILE2>
```

For each pair of input lines with identical join fields, write a line to
standard output. The default join field is the first, delimited by blanks.

When `FILE1` or `FILE2` (not both) is `-`, read standard input.
13 changes: 6 additions & 7 deletions src/uu/join/src/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ use std::num::IntErrorKind;
use std::os::unix::ffi::OsStrExt;
use uucore::display::Quotable;
use uucore::error::{set_exit_code, UError, UResult, USimpleError};
use uucore::{crash, crash_if_err};
use uucore::{crash, crash_if_err, format_usage, help_about, help_usage};

const ABOUT: &str = help_about!("join.md");
const USAGE: &str = help_usage!("join.md");

#[derive(Debug)]
enum JoinError {
Expand Down Expand Up @@ -699,12 +702,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(crate_version!())
.about(
"For each pair of input lines with identical join fields, write a line to
standard output. The default join field is the first, delimited by blanks.

When FILE1 or FILE2 (not both) is -, read standard input.",
)
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new("a")
Expand Down