diff --git a/src/entry/mod.rs b/src/entrypoint/mod.rs similarity index 63% rename from src/entry/mod.rs rename to src/entrypoint/mod.rs index 10003b7..54ff10f 100644 --- a/src/entry/mod.rs +++ b/src/entrypoint/mod.rs @@ -1,10 +1,12 @@ + +// Select main script for target system cfg_if::cfg_if! { if #[cfg(target_family = "unix")] { mod unix; pub use unix::main as main_e; } else { - pub fn main_e () -> Result<(), std::io::Error> { + pub fn main_e() -> Result<(), std::io::Error> { unimplemented!("Not yet implemented."); } } diff --git a/src/entry/unix/mod.rs b/src/entrypoint/unix/mod.rs similarity index 100% rename from src/entry/unix/mod.rs rename to src/entrypoint/unix/mod.rs diff --git a/src/entry/unix/promptbuffer.rs b/src/entrypoint/unix/promptbuffer.rs similarity index 100% rename from src/entry/unix/promptbuffer.rs rename to src/entrypoint/unix/promptbuffer.rs diff --git a/src/entry/unix/unix.rs b/src/entrypoint/unix/unix.rs similarity index 87% rename from src/entry/unix/unix.rs rename to src/entrypoint/unix/unix.rs index b6e5d43..2df098e 100644 --- a/src/entry/unix/unix.rs +++ b/src/entrypoint/unix/unix.rs @@ -13,17 +13,6 @@ use super::promptbuffer::PromptBuffer; use crate::command; use crate::context::Context; -/* -Make this a macro: - #[cfg(debug_assertions)] - RawTerminal::suspend_raw_mode(&stdout).unwrap(); - - code - - #[cfg(debug_assertions)] - RawTerminal::activate_raw_mode(&stdout).unwrap(); -*/ - #[inline(always)] pub fn main() -> Result<(), std::io::Error> { @@ -43,12 +32,6 @@ pub fn main() -> Result<(), std::io::Error> { return Ok(()); } - - //let size = termion::terminal_size().unwrap(); - //write!(stdout, "{:?}", size).unwrap(); - - - 'outer: loop { pb.write_prompt(&mut stdout, &context)?; diff --git a/src/main.rs b/src/main.rs index 699e293..fa97ee6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,15 +6,17 @@ pub mod context; pub mod errors; pub mod formattedtext; -mod entry; -use crate::entry::main_e; - use crate::parser::substitute; use crate::errors::DaisyError; use crate::formattedtext::FormattedText; use crate::context::Context; use crate::parser::LineLocation; + +// Run main script for target system +mod entrypoint; +use crate::entrypoint::main_e; + #[cfg(test)] mod tests;