2
0
mirror of https://github.com/xvxx/phetch synced 2024-11-10 13:10:54 +00:00

-l to quick connect to a local gopher server

This commit is contained in:
dvkt 2020-01-04 11:40:30 -08:00
parent 991c8c96a4
commit 10b4c8adf1
2 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,7 @@ the gophersphere.
phetch launch and show start page phetch launch and show start page
phetch <gopher-url> open gopher url phetch <gopher-url> open gopher url
phetch -r, --raw <gopher-url> print raw gopher response phetch -r, --raw <gopher-url> print raw gopher response
phetch -l, --local connect to 127.0.0.1:7070
phetch -h, --help show this screen phetch -h, --help show this screen
phetch -v, --version show phetch version phetch -v, --version show phetch version

View File

@ -7,7 +7,7 @@ fn main() {
fn run() -> i32 { fn run() -> i32 {
let args: Vec<String> = std::env::args().collect(); let args: Vec<String> = std::env::args().collect();
let url = if args.len() < 2 { let mut url = if args.len() < 2 {
"gopher://phetch/1/home" "gopher://phetch/1/home"
} else { } else {
args.get(1).unwrap() args.get(1).unwrap()
@ -24,6 +24,10 @@ fn run() -> i32 {
} }
} }
if url == "--local" || url == "-l" || url == "-local" {
url = "gopher://127.0.0.1:7070";
}
if url == "--version" || url == "-v" || url == "-version" { if url == "--version" || url == "-v" || url == "-version" {
print_version(); print_version();
return 0; return 0;
@ -59,6 +63,7 @@ fn print_usage() {
phetch launch and show start page phetch launch and show start page
phetch <gopher-url> open gopherhole at url phetch <gopher-url> open gopherhole at url
phetch -r, --raw <gopher-url> print raw gopher response phetch -r, --raw <gopher-url> print raw gopher response
phetch -l, --local connect to 127.0.0.1:7070
phetch -h, --help show this screen phetch -h, --help show this screen
phetch -v, --version show phetch version phetch -v, --version show phetch version