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>> {
let args = Cli::from_args();
// If the CLI was provided a directory to open use it.
// Otherwise, attempt to find the home directory. If that fails use CWD.
let root_path = args
.path
.or_else(dirs::home_dir)
.unwrap_or_else(|| std::env::current_dir().expect("Failed to access filesystem."));
let root_path = match args.path {
// If the CLI was provided a directory convert it to absolute.
Some(path) => std::path::absolute(path)?,
// If no path was provided, use current directory.
None => std::env::current_dir().unwrap_or_else(|_|
// 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.
match args.tui {