summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorSam Tay <sam.chong.tay@gmail.com>2020-06-08 13:56:51 -0700
committerSam Tay <sam.chong.tay@gmail.com>2020-06-08 13:56:51 -0700
commit613e1196b5e89d320283c4cea44a5d450616a932 (patch)
tree56844ba825adf92c3f4e96ca397a0931fd8f8f8f /src/main.rs
parent3805b4ef067dbab23c4d9116bb46892f661657c9 (diff)
Implement --set-api-keyv0.1.1
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/main.rs b/src/main.rs
index 8ce16cc..57d561c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -23,6 +23,10 @@ fn main() {
let site = &config.site;
let mut ls = LocalStorage::new()?;
+ if let Some(key) = opts.set_api_key {
+ config::set_api_key(key)?;
+ }
+
if opts.update_sites {
ls.update_sites()?;
}
@@ -88,7 +92,7 @@ fn main() {
this shouldn't be possible!",
)
})?;
- // TODO eventually do this in the right place, e.g. abstract out md parser & do within threads
+ // TODO eventually do this in the right place, e.g. abstract out md parser, write benches, & do within threads
let md = ans.body.replace("<kbd>", "**[").replace("</kbd>", "]**");
skin.print_text(&md);
}
@@ -104,12 +108,3 @@ fn main() {
println!("panic! {}", e.error);
});
}
-
-#[cfg(test)]
-mod tests {
-
- #[test]
- fn test_main() {
- //TODO
- }
-}