aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-07-17 11:34:15 +0000
committerFuwn <[email protected]>2022-07-17 11:34:15 +0000
commitecafc617b5693762822937cf09d330569fc01a2b (patch)
treea675f4062d5768c1a3981b6b9b441d692fb56a9d /src
parentdocs(README.md): expanding gif link (diff)
downloadsydney-ecafc617b5693762822937cf09d330569fc01a2b.tar.xz
sydney-ecafc617b5693762822937cf09d330569fc01a2b.zip
feat(input.rs): add help command
Diffstat (limited to 'src')
-rw-r--r--src/app.rs2
-rw-r--r--src/command.rs2
-rw-r--r--src/input.rs5
3 files changed, 7 insertions, 2 deletions
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<String>),
Unknown,
Wrap(u16, Option<String>),
+ Help,
}
impl From<String> for Command {
fn from(s: String) -> Self {
@@ -51,6 +52,7 @@ impl From<String> 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;