Update to use clap.

Structopt is deprecated.
Also removed some unused dependencies.
This commit is contained in:
2026-01-20 12:24:20 -05:00
parent 2713d29285
commit ecd94a2621
3 changed files with 97 additions and 147 deletions

View File

@@ -1,30 +1,30 @@
use anyhow::Result;
use clap::Parser;
use std::process::{Command, Stdio};
use structopt::StructOpt;
pub mod gui;
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.
/// If no path is provided, the current directory is used.
#[derive(StructOpt, Debug)]
#[derive(Parser, Debug)]
#[structopt(name = "clide", verbatim_doc_comment)]
struct Cli {
/// The root directory for the project to open with the clide editor.
#[structopt(parse(from_os_str))]
#[arg(value_parser = clap::value_parser!(std::path::PathBuf))]
pub path: Option<std::path::PathBuf>,
/// Run clide in headless mode.
#[structopt(name = "tui", short, long)]
#[arg(value_name = "tui", short, long)]
pub tui: bool,
/// Run the clide GUI in the current process, blocking the terminal and showing all output streams.
#[structopt(name = "gui", short, long)]
#[arg(value_name = "gui", short, long)]
pub gui: bool,
}
fn main() -> Result<()> {
let args = Cli::from_args();
let args = Cli::parse();
let root_path = match args.path {
// If the CLI was provided a directory, convert it to absolute.