start screen

pull/6/head
dvkt 5 years ago
parent fb025ddfcf
commit 6c2d94f186

@ -22,13 +22,12 @@
## usage
phetch # Launch and show start page.
phetch <gopher-url> # Show Gopherhole at URL
phetch -r <gopher-url> # Print raw Gopher response.
phetch -h # Show this screen.
phetch -v # Show phetch version.
Once you've launched `phetch`, use `Ctrl-H` to view the on-line help.
## installation
Binaries for Linux and Mac are available at https://github.com/dvkt/phetch/releases:
@ -54,18 +53,11 @@ Just unzip/untar the `phetch` program into your $PATH and get going!
### basics
- [ ] download to ~/Downloads
gopher://zaibatsu.circumlunar.space/1/~cardboard64/
- [ ] save history to file
- [ ] load history from file
- [ ] load most recent URL when opening without args
- [ ] ipv6
- [ ] flesh out help
### bonus
- [ ] TLS
- [ ] fuzzy find search links
- https://github.com/stewart/rff
- https://github.com/Schlechtwetterfront/fuzzy-rs
- [ ] detect SIGWINCH
- https://github.com/BurntSushi/chan-signal
### bugs
- [ ] `open` for irc links
- [ ] gopher lawn is truncate
## screenies

@ -5,7 +5,7 @@ use std::net::TcpStream;
use std::net::ToSocketAddrs;
use std::time::Duration;
pub const TCP_TIMEOUT_IN_SECS: u64 = 4;
pub const TCP_TIMEOUT_IN_SECS: u64 = 8;
pub const TCP_TIMEOUT_DURATION: Duration = Duration::from_secs(TCP_TIMEOUT_IN_SECS);
#[derive(Copy, Clone, PartialEq, Debug)]

@ -3,10 +3,34 @@ pub fn lookup(name: &str) -> Option<&str> {
"" | "/" | "help" => Some(HELP),
"types" => Some(TYPES),
"nav" => Some(NAV),
"home" => Some(HOME),
_ => None,
}
}
pub const HOME: &str = "
i
i
i / / /
i ___ (___ ___ (___ ___ (___
i| )| )|___)| | | )
i|__/ | / |__ |__ |__ | /
i|
i
i~ the quick lil gopher client ~
i
7search gopher /v2/vs gopher.floodgap.com
i
1welcome to gopherspace /gopher gopher.floodgap.com
1gopher lawn /lawn bitreich.org
i
i ~ * ~
i
1phetch help (ctrl+h) / help
hphetch homepage URL:https://github.com/dvkt/phetch
i
";
pub const HELP: &str = "
i
i
@ -26,9 +50,9 @@ ipage up scroll page up
ipage down scroll page down
i
ictrl-g go to gopher url
ictrl-u show current gopher url
ictrl-u show gopher url
ictrl-y copy url to clipboard
ictrl-r view raw version of page
ictrl-r view raw source
ictrl-w toggle wide mode
i
i ~ * ~
@ -122,4 +146,7 @@ i
+Mirrors
TTelnet3270
i
hGopher is RFC 1436
hGopher is RFC 1436 /html/rfc1436 help
i https://tools.ietf.org/html/rfc1436
";

@ -12,12 +12,11 @@ use ui::UI;
fn main() {
let args: Vec<String> = std::env::args().collect();
if args.len() < 2 {
print_usage();
return;
}
let url = args.get(1).unwrap();
let url = if args.len() < 2 {
"gopher://help/1/home"
} else {
args.get(1).unwrap()
};
if url == "--raw" || url == "-r" || url == "-raw" {
if args.len() > 2 {
@ -67,6 +66,7 @@ fn print_version() {
fn print_usage() {
println!(
"\x1B[93;1mUsage:\x1B[0m
phetch # Launch and show start page.
phetch <gopher-url> # Open Gopherhole at URL.
phetch -r, --raw <gopher-url> # Print raw Gopher response.
phetch -h, --help # Show this screen.

@ -1,4 +1,3 @@
use ui;
use ui::{Action, Key, View, MAX_COLS, SCROLL_LINES};
pub struct Text {

@ -204,6 +204,10 @@ impl UI {
let dotdir = dotdir.unwrap();
let mut out = String::new();
for page in &self.pages {
let url = page.url();
if url.starts_with("gopher://help/") {
continue;
}
out.push_str(&page.url());
out.push('\n');
}

Loading…
Cancel
Save