TUI #1

Merged
shaunrd0 merged 73 commits from ui into master 2026-01-25 20:57:37 +00:00
Showing only changes of commit a29ae43e84 - Show all commits

View File

@ -49,12 +49,14 @@ struct Cli {
fn main() -> Result<(), Box<dyn Error>> { fn main() -> Result<(), Box<dyn Error>> {
let args = Cli::from_args(); let args = Cli::from_args();
// If the CLI was provided a directory to open use it. let root_path = match args.path {
// Otherwise, attempt to find the home directory. If that fails use CWD. // If the CLI was provided a directory convert it to absolute.
let root_path = args Some(path) => std::path::absolute(path)?,
.path // If no path was provided, use current directory.
.or_else(dirs::home_dir) None => std::env::current_dir().unwrap_or_else(|_|
.unwrap_or_else(|| std::env::current_dir().expect("Failed to access filesystem.")); // If we can't find the CWD attempt to open the home directory.
dirs::home_dir().expect("Failed to access filesystem.")),
};
// Open the TUI editor if requested, otherwise use the QML GUI by default. // Open the TUI editor if requested, otherwise use the QML GUI by default.
match args.tui { match args.tui {