2
0
mirror of https://github.com/xvxx/phetch synced 2024-11-05 00:00:58 +00:00

update -h style

This commit is contained in:
dvkt 2020-01-07 09:51:38 -08:00
parent c819c1f65e
commit 204b587d02
2 changed files with 42 additions and 22 deletions

View File

@ -25,16 +25,23 @@ the gophersphere.
## usage
phetch launch and show start page
phetch <gopher-url> open gopher url
phetch -t, --tls <gopher-url> try to open all pages w/ tls
phetch -r, --raw <gopher-url> print raw gopher response
phetch -p, --print <gopher-url> print rendered gopher response
phetch -l, --local connect to 127.0.0.1:7070
phetch -h, --help show this screen
phetch -v, --version show phetch version
Usage:
phetch [options] launch phetch in interactive mode
phetch [options] [url] open gopher url in interactive mode
Options:
-t, --tls try to open all pages w/ tls
-r, --raw print raw gopher response only
-p, --print print rendered gopher response only
-l, --local connect to 127.0.0.1:7070
-h, --help show this screen
-v, --version show phetch version
Once you've launched phetch, use `ctrl-h` to view the on-line help.
once you've launched phetch, use `ctrl-h` to view the on-line help.
## installation

View File

@ -50,10 +50,12 @@ fn run() -> i32 {
}
arg => {
if arg.starts_with('-') {
eprintln!("unknown flag: {}", url);
print_version();
eprintln!("unknown flag: {}", arg);
return 1;
} else if got_url {
eprintln!("unknown argument: {}", url);
print_version();
eprintln!("unknown argument: {}", arg);
return 1;
} else {
got_url = true;
@ -96,22 +98,33 @@ fn run() -> i32 {
}
fn print_version() {
println!("phetch v{}", phetch::VERSION);
println!(
"phetch - quick lil gopher client (v{version} - {built})",
built = phetch::BUILD_DATE,
version = phetch::VERSION
);
}
fn print_usage() {
print_version();
println!(
"Usage:
phetch launch and show start page
phetch <gopher-url> open gopherhole at url
phetch -t, --tls <gopher-url> try to open all pages w/ tls
phetch -r, --raw <gopher-url> print raw gopher response
phetch -p, --print <gopher-url> print rendered gopher response
phetch -l, --local connect to 127.0.0.1:7070
phetch -h, --help show this screen
phetch -v, --version show phetch version
"
Usage:
Once you've launched phetch, use `ctrl-h` to view the on-line help."
\tphetch [options] launch phetch in interactive mode
\tphetch [options] [url] open gopher url in interactive mode
Options:
-t, --tls try to open all pages w/ tls
-r, --raw print raw gopher response only
-p, --print print rendered gopher response only
-l, --local connect to 127.0.0.1:7070
-h, --help show this screen
-v, --version show phetch version
Once you've launched phetch, use `ctrl-h` to view the on-line help. "
);
}