From ecafc617b5693762822937cf09d330569fc01a2b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 17 Jul 2022 11:34:15 +0000 Subject: feat(input.rs): add help command --- src/app.rs | 2 +- src/command.rs | 2 ++ src/input.rs | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/app.rs b/src/app.rs index d6a9a2d..c55ca33 100644 --- a/src/app.rs +++ b/src/app.rs @@ -41,7 +41,7 @@ pub struct App { } impl App { pub fn new() -> Self { - let url = Url::parse("gemini://gemini.circumlunar.space/").unwrap(); + let url = Url::parse("gemini://gem.rest/projects/sydney.gmi").unwrap(); let mut app = Self { response_input: String::new(), diff --git a/src/command.rs b/src/command.rs index 66f3139..7a53bf7 100644 --- a/src/command.rs +++ b/src/command.rs @@ -20,6 +20,7 @@ pub enum Command { Open(Option), Unknown, Wrap(u16, Option), + Help, } impl From for Command { fn from(s: String) -> Self { @@ -51,6 +52,7 @@ impl From for Command { } }, ), + Some("help" | "h") => Self::Help, _ => Self::Unknown, } } diff --git a/src/input.rs b/src/input.rs index 1e8e083..54065ac 100644 --- a/src/input.rs +++ b/src/input.rs @@ -170,7 +170,6 @@ fn handle_editing_input( }) .unwrap(), ); - app.make_request(); } else { app.error = Some("No URL provided for open command".to_string()); @@ -187,6 +186,10 @@ fn handle_editing_input( app.make_request(); }, + Command::Help => { + app.set_url(Url::parse("gemini://gem.rest/projects/sydney.gmi").unwrap()); + app.make_request(); + } } app.input_mode = Mode::Normal; -- cgit v1.2.3