-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use std::collections::HashMap; | ||
|
||
pub enum CurrentScreen { | ||
Main, | ||
Editing, | ||
Exiting, | ||
} | ||
|
||
pub enum CurrentlyEditing { | ||
Key, | ||
Value, | ||
} | ||
|
||
pub struct App { | ||
pub key_input: String, | ||
pub value_input: String, | ||
pub pairs: HashMap<String, String>, | ||
pub current_screen: CurrentScreen, | ||
pub currently_editing: Option<CurrentlyEditing>, | ||
} | ||
|
||
impl App { | ||
pub fn new() -> App { | ||
App { | ||
key_input: String::new(), | ||
value_input: String::new(), | ||
pairs: HashMap::new(), | ||
current_screen: CurrentScreen::Main, | ||
currently_editing: None, | ||
} | ||
} | ||
|
||
pub fn save_key_value(&mut self) { | ||
self.pairs | ||
.insert(self.key_input.clone(), self.value_input.clone()); | ||
|
||
self.key_input = String::new(); | ||
self.value_input = String::new(); | ||
self.currently_editing = None; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ use color_eyre::{ | |
Result, | ||
}; | ||
|
||
mod app; | ||
mod errors; | ||
mod tui; | ||
|
||
|