Factor out TUI code.
This commit is contained in:
parent
fd3c8fb204
commit
f4242f7749
@ -5,11 +5,7 @@ use std::process::{Command, Stdio};
|
||||
use structopt::StructOpt;
|
||||
|
||||
pub mod gui;
|
||||
|
||||
fn run_tui(root_path: std::path::PathBuf) -> Result<(), Box<dyn Error>> {
|
||||
println!("Starting the TUI editor at {:?}", root_path);
|
||||
Ok(())
|
||||
}
|
||||
pub mod tui;
|
||||
|
||||
/// Command line interface IDE with full GUI and headless modes.
|
||||
/// If no flags are provided the GUI editor is launched in a separate process.
|
||||
@ -46,7 +42,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
true => gui::run(root_path),
|
||||
false => match args.tui {
|
||||
// Open the TUI editor if requested, otherwise use the QML GUI by default.
|
||||
true => run_tui(root_path),
|
||||
true => tui::run(root_path),
|
||||
false => {
|
||||
// Relaunch the CLIDE GUI in a separate process.
|
||||
Command::new(std::env::current_exe()?)
|
||||
|
||||
6
src/tui.rs
Normal file
6
src/tui.rs
Normal file
@ -0,0 +1,6 @@
|
||||
use std::error::Error;
|
||||
|
||||
pub fn run(root_path: std::path::PathBuf) -> Result<(), Box<dyn Error>> {
|
||||
println!("Starting the TUI editor at {:?}", root_path);
|
||||
Ok(())
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user