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

seq: move help strings to markdown file #4779

Merged
merged 3 commits into from
Apr 24, 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
9 changes: 9 additions & 0 deletions src/uu/seq/seq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# seq

Display numbers from FIRST to LAST, in steps of INCREMENT.

```
seq [OPTION]... LAST
seq [OPTION]... FIRST LAST
seq [OPTION]... FIRST INCREMENT LAST";
```
21 changes: 9 additions & 12 deletions src/uu/seq/src/seq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// *
// * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code.
// TODO: Support -f flag
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-f options is implemented in #2918

// spell-checker:ignore (ToDO) istr chiter argptr ilen extendedbigdecimal extendedbigint numberparse
use std::io::{stdout, ErrorKind, Write};
use std::process::exit;
Expand All @@ -12,9 +11,9 @@ use num_traits::Zero;

use uucore::error::FromIo;
use uucore::error::UResult;
use uucore::format_usage;
use uucore::memo::printf;
use uucore::show;
use uucore::{format_usage, help_about, help_usage};

mod error;
mod extendedbigdecimal;
Expand All @@ -27,17 +26,15 @@ use crate::extendedbigint::ExtendedBigInt;
use crate::number::Number;
use crate::number::PreciseNumber;

static ABOUT: &str = "Display numbers from FIRST to LAST, in steps of INCREMENT.";
const USAGE: &str = "\
{} [OPTION]... LAST
{} [OPTION]... FIRST LAST
{} [OPTION]... FIRST INCREMENT LAST";
static OPT_SEPARATOR: &str = "separator";
static OPT_TERMINATOR: &str = "terminator";
static OPT_WIDTHS: &str = "widths";
static OPT_FORMAT: &str = "format";
const ABOUT: &str = help_about!("seq.md");
const USAGE: &str = help_usage!("seq.md");

static ARG_NUMBERS: &str = "numbers";
const OPT_SEPARATOR: &str = "separator";
const OPT_TERMINATOR: &str = "terminator";
const OPT_WIDTHS: &str = "widths";
const OPT_FORMAT: &str = "format";

const ARG_NUMBERS: &str = "numbers";

#[derive(Clone)]
struct SeqOptions<'a> {
Expand Down