Unverified Commit a532878d authored by Jeremy Soller's avatar Jeremy Soller Committed by GitHub

Merge pull request #34 from bltnkl/unify_man_page_name

change man constant names to MAN_PAGE
parents e549bd73 38dbab28
......@@ -8,7 +8,7 @@ use std::io::{self, Write, Read};
use extra::option::OptionalExt;
use extra::io::fail;
static HELP: &'static str = /* @MANSTART{cur} */ r#"
static MAN_PAGE: &'static str = /* @MANSTART{cur} */ r#"
NAME
cur - freely move you cursor using H, J, K, and L (Vi-bindings).
......@@ -68,7 +68,7 @@ fn main() {
match i.as_str() {
// Print the help page.
"-h" | "--help" => {
stdout.write(HELP.as_bytes()).try(&mut stderr);
stdout.write(MAN_PAGE.as_bytes()).try(&mut stderr);
},
// This argument is unknown.
_ => fail("unknown argument.", &mut stderr),
......
......@@ -2,7 +2,7 @@ use std::env;
use std::io::{stdout, Write};
use std::process::Command;
static HELP: &'static str = /* @MANSTART{info} */ r#"
static MAN_PAGE: &'static str = /* @MANSTART{info} */ r#"
NAME
info - view an info page.
......@@ -44,7 +44,7 @@ fn main() {
match arg.as_str() {
"--help" | "-h" => {
// Print help.
stdout().write(HELP.as_bytes()).unwrap();
stdout().write(MAN_PAGE.as_bytes()).unwrap();
return;
},
page => {
......
......@@ -12,7 +12,7 @@ use std::path::Path;
use extra::option::OptionalExt;
use termion::raw::IntoRawMode;
static LONG_HELP: &'static str = /* @MANSTART{less} */ r#"
static MAN_PAGE: &'static str = /* @MANSTART{less} */ r#"
NAME
less - view a text file.
......@@ -59,7 +59,7 @@ fn main() {
if let Some(x) = args.peek() {
if x == "--help" || x == "-h" {
// Print help.
io::stdout().write(LONG_HELP.as_bytes()).try(&mut stderr);
io::stdout().write(MAN_PAGE.as_bytes()).try(&mut stderr);
return;
}
} else {
......
......@@ -2,7 +2,7 @@ use std::env;
use std::io::{stdout, stderr, Write};
use std::process::{self, Command};
static HELP: &'static str = /* @MANSTART{man} */ r#"
static MAN_PAGE: &'static str = /* @MANSTART{man} */ r#"
NAME
man - view a man page.
......@@ -44,7 +44,7 @@ fn main() {
match arg.as_str() {
"--help" | "-h" => {
// Print help.
stdout().write(HELP.as_bytes()).unwrap();
stdout().write(MAN_PAGE.as_bytes()).unwrap();
return;
},
page => {
......
......@@ -18,7 +18,7 @@ use termion::event::Key;
use termion::input::TermRead;
use termion::raw::{IntoRawMode, RawTerminal};
static LONG_HELP: &'static str = /* @MANSTART{mdless} */ r#"
static MAN_PAGE: &'static str = /* @MANSTART{mdless} */ r#"
NAME
mdless- view a markdown file.
......@@ -77,7 +77,7 @@ fn main() {
if let Some(x) = args.peek() {
if x == "--help" || x == "-h" {
// Print help.
stdout.write(LONG_HELP.as_bytes()).try(&mut stderr);
stdout.write(MAN_PAGE.as_bytes()).try(&mut stderr);
return;
}
} else {
......
......@@ -11,7 +11,7 @@ use std::process::exit;
use extra::option::OptionalExt;
use extra::io::{fail, WriteExt};
static HELP: &'static str = /* @MANSTART{mtxt} */ r#"
static MAN_PAGE: &'static str = /* @MANSTART{mtxt} */ r#"
NAME
mtxt - a simple tool to manipulate text from standard input.
......@@ -90,7 +90,7 @@ fn main() {
"-a" | "--strip-non-ascii" => strip_non_ascii = true,
"-h" | "--help" => {
// The help page.
stdout.write(HELP.as_bytes()).try(&mut stderr);
stdout.write(MAN_PAGE.as_bytes()).try(&mut stderr);
},
a => {
// The argument, a, is unknown.
......
......@@ -10,7 +10,7 @@ use std::time::Duration;
use extra::option::OptionalExt;
static LONG_HELP: &'static str = /* @MANSTART{rem} */ r#"
static MAN_PAGE: &'static str = /* @MANSTART{rem} */ r#"
NAME
rem - set a count-down.
......@@ -109,7 +109,7 @@ fn main() {
match arg.as_str() {
"--help" => {
// Print help.
stdout.write(LONG_HELP.as_bytes()).try(&mut stderr);
stdout.write(MAN_PAGE.as_bytes()).try(&mut stderr);
return;
},
"-h" => {
......
......@@ -16,7 +16,7 @@ use extra::option::OptionalExt;
use termion::{async_stdin, clear, cursor, style, terminal_size};
use termion::raw::IntoRawMode;
static LONG_HELP: &'static str = /* @MANSTART{watch} */ r#"
static MAN_PAGE: &'static str = /* @MANSTART{watch} */ r#"
NAME
watch - execute a program periodically, showing output fullscreen
......@@ -67,7 +67,7 @@ fn main() {
match x.as_str() {
"--help" | "-h" => {
// Print help.
stdout.write(LONG_HELP.as_bytes()).try(&mut stderr);
stdout.write(MAN_PAGE.as_bytes()).try(&mut stderr);
return;
},
"--interval" | "-n" => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment