Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
extrautils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nagy Tibor
extrautils
Commits
38dbab28
Commit
38dbab28
authored
Jan 05, 2018
by
Bulat Musin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change man constant names to MAN_PAGE
parent
e549bd73
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
16 deletions
+16
-16
src/bin/cur.rs
src/bin/cur.rs
+2
-2
src/bin/info.rs
src/bin/info.rs
+2
-2
src/bin/less.rs
src/bin/less.rs
+2
-2
src/bin/man.rs
src/bin/man.rs
+2
-2
src/bin/mdless.rs
src/bin/mdless.rs
+2
-2
src/bin/mtxt.rs
src/bin/mtxt.rs
+2
-2
src/bin/rem.rs
src/bin/rem.rs
+2
-2
src/bin/watch.rs
src/bin/watch.rs
+2
-2
No files found.
src/bin/cur.rs
View file @
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
),
...
...
src/bin/info.rs
View file @
38dbab28
...
...
@@ -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
=>
{
...
...
src/bin/less.rs
View file @
38dbab28
...
...
@@ -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
{
...
...
src/bin/man.rs
View file @
38dbab28
...
...
@@ -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
=>
{
...
...
src/bin/mdless.rs
View file @
38dbab28
...
...
@@ -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
{
...
...
src/bin/mtxt.rs
View file @
38dbab28
...
...
@@ -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.
...
...
src/bin/rem.rs
View file @
38dbab28
...
...
@@ -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"
=>
{
...
...
src/bin/watch.rs
View file @
38dbab28
...
...
@@ -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"
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment