use clap::Parser;
const LONG_ABOUT: &str = "\
A modern, retro-styled terminal multiplexer with a classic MS-DOS aesthetic.
Features a full-screen text-based interface with authentic DOS-style rendering.
███████████ ██████████ ███████████ ██████ ██████ ████████ ████████
░█░░░███░░░█░░███░░░░░█░░███░░░░░███ ░░██████ ██████ ███░░░░███ ███░░░░███
░ ░███ ░ ░███ █ ░ ░███ ░███ ░███░█████░███ ░░░ ░███░███ ░███
░███ ░██████ ░██████████ ░███░░███ ░███ ██████░ ░░█████████
░███ ░███░░█ ░███░░░░░███ ░███ ░░░ ░███ ░░░░░░███ ░░░░░░░███
░███ ░███ ░ █ ░███ ░███ ░███ ░███ ███ ░███ ███ ░███
█████ ██████████ █████ █████ █████ █████░░████████ ░░████████
░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░░░ ░░░░░░░░
KEYBOARD SHORTCUTS:
't' - Create new terminal window
'T' - Create new maximized terminal window
'q' / ESC - Exit application (from desktop)
'?' - Show help screen
's' - Show settings/configuration window
'c' - Show calendar
CTRL+Space - Command launcher (Slight)
CTRL+L - Clear terminal
CTRL+S - Save session manually
ALT+TAB - Switch between windows
MOUSE CONTROLS:
Click title bar - Drag window
CTRL+Drag - Drag without snap
Click [X] - Close window
Drag border - Resize window
Click window - Focus window
";
#[derive(Parser, Debug)]
#[command(
name = "term39",
version = env!("CARGO_PKG_VERSION"),
author = env!("CARGO_PKG_AUTHORS"),
about = "A modern, retro-styled terminal multiplexer with a classic MS-DOS aesthetic",
long_about = LONG_ABOUT,
after_help = "For more information, visit: https://github.com/alejandroqh/term39"
)]
pub struct Cli {
#[arg(long, help = "Use ASCII-compatible characters instead of Unicode")]
pub ascii: bool,
#[arg(long, help = "Use single-line Unicode box drawing characters")]
pub single_line: bool,
#[arg(long, value_name = "THEME", help = "Set the color theme")]
pub theme: Option<String>,
#[arg(long, help = "Apply theme-based tinting to terminal content")]
pub tint_terminal: bool,
#[arg(long, help = "Don't restore previous session on startup")]
pub no_restore: bool,
#[arg(long, help = "Don't save session (disables auto-save and manual save)")]
pub no_save: bool,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(
long = "framebuffer",
short = 'f',
help = "Enable framebuffer mode (Linux console only)"
)]
pub framebuffer: bool,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(
long,
value_name = "MODE",
default_value = "80x25",
help = "Framebuffer text mode"
)]
pub fb_mode: String,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(
long,
value_name = "SCALE",
help = "Pixel scale factor (1, 2, 3, 4, or auto)"
)]
pub fb_scale: Option<String>,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(
long,
value_name = "FONT",
help = "Console font name (e.g., Unifont-APL8x16)"
)]
pub fb_font: Option<String>,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(long, help = "List available console fonts and exit")]
pub fb_list_fonts: bool,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(
long,
value_name = "DEVICE",
help = "Mouse input device (e.g., /dev/input/event2)"
)]
pub mouse_device: Option<String>,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(long, help = "Invert mouse X-axis for framebuffer mode")]
pub invert_mouse_x: bool,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(long, help = "Invert mouse Y-axis for framebuffer mode")]
pub invert_mouse_y: bool,
#[cfg(all(target_os = "linux", feature = "framebuffer-backend"))]
#[arg(long, help = "Launch framebuffer setup wizard")]
pub fb_setup: bool,
#[cfg(target_os = "linux")]
#[arg(
long,
help = "Swap left/right mouse buttons (use if clicks are reversed)"
)]
pub swap_mouse_buttons: bool,
#[cfg(target_os = "linux")]
#[arg(
long,
value_name = "SENSITIVITY",
help = "Mouse sensitivity for Linux console (0.1-5.0, default: auto)"
)]
pub mouse_sensitivity: Option<f32>,
#[arg(
long,
help = "Disable exit functionality (for use as a window manager)"
)]
pub no_exit: bool,
#[arg(
long,
value_name = "PROFILE",
help = "Set the keybinding profile (term39, hyprland)"
)]
pub keybindings: Option<String>,
#[arg(
long,
value_name = "PATH",
help = "Path to shell executable for terminal windows"
)]
pub shell: Option<String>,
#[cfg(unix)]
#[arg(long, help = "Lock a running term39 instance and exit")]
pub lock: bool,
#[cfg(unix)]
#[arg(long, help = "Start a temporary session (no background daemon)")]
pub no_persist: bool,
#[cfg(unix)]
#[arg(long, help = "Force-attach, kicking any existing client")]
pub force_attach: bool,
}
impl Cli {
pub fn parse_args() -> Self {
Self::parse()
}
}