From 437f42f8d30fb6d4843738fbd46bb801679443a7 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Tue, 4 Jan 2022 19:25:26 +0100 Subject: [PATCH] Migrate from structopt to clap 3 --- CHANGELOG.md | 4 + Cargo.lock | 193 ++++++++++++++----------------- alacritty/Cargo.toml | 8 +- alacritty/src/cli.rs | 85 +++++++------- extra/completions/_alacritty | 93 +++++++-------- extra/completions/alacritty.bash | 31 ++--- extra/completions/alacritty.fish | 53 ++++----- 7 files changed, 219 insertions(+), 248 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 397d5514..23a1da24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Minimum Rust version has been bumped to 1.56.0 +### Changed + +- The `--help` output was reworked with a new colorful syntax + ## 0.10.0 ### Packaging diff --git a/Cargo.lock b/Cargo.lock index e865e88e..be47ee94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,6 +16,7 @@ dependencies = [ "alacritty_terminal", "bitflags", "clap", + "clap_complete", "cocoa", "copypasta", "crossfont", @@ -34,7 +35,6 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "structopt", "time", "unicode-width", "wayland-client", @@ -88,15 +88,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "atty" version = "0.2.14" @@ -177,17 +168,41 @@ dependencies = [ [[package]] name = "clap" -version = "2.34.0" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "17a98d95cbe8abdf3bfe1a2bd4aa7215700403b79a0eb03cbddb017a5824e186" dependencies = [ - "ansi_term", "atty", "bitflags", - "strsim 0.8.0", + "clap_derive", + "indexmap", + "lazy_static", + "os_str_bytes", + "strsim", + "termcolor", "textwrap", - "unicode-width", - "vec_map", +] + +[[package]] +name = "clap_complete" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a394f7ec0715b42a4e52b294984c27c9a61f77c8d82f7774c5198350be143f19" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_derive" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "448c8b00367288ad41804ac7a9e0fe58f2324a36901cb5d6b6db58be86d1db8f" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -404,7 +419,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", + "strsim", "syn", ] @@ -419,17 +434,6 @@ dependencies = [ "syn", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "dirs" version = "3.0.2" @@ -725,12 +729,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" @@ -855,9 +856,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.109" +version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01" +checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" [[package]] name = "libloading" @@ -1141,19 +1142,18 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" +checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" dependencies = [ - "derivative", "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" +checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1192,9 +1192,18 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" + +[[package]] +name = "os_str_bytes" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +dependencies = [ + "memchr", +] [[package]] name = "osmesa-sys" @@ -1289,18 +1298,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] [[package]] -name = "quote" -version = "1.0.10" +name = "quick-xml" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" dependencies = [ "proc-macro2", ] @@ -1350,9 +1368,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "ryu" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "254df5081ce98661a883445175e52efe99d1cb2a5552891d965d2f5d0cad1c16" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "same-file" @@ -1451,9 +1469,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35dfd12afb7828318348b8c408383cf5071a086c1d4ab1c0f9840ec92dbb922" +checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" dependencies = [ "libc", "signal-hook-registry", @@ -1527,47 +1545,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be6c3f39c37a4283ee4b43d1311c828f2e1fb0541e76ea0cb1a2abd9ef2f5b3b" -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "structopt" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" -dependencies = [ - "clap", - "lazy_static", - "structopt-derive", -] - -[[package]] -name = "structopt-derive" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "syn" -version = "1.0.82" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59" +checksum = "ecb2e6da8ee5eb9a61068762a32fa9619cc591ceb055b3687f4cd4051ec2e06b" dependencies = [ "proc-macro2", "quote", @@ -1575,14 +1563,20 @@ dependencies = [ ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "termcolor" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" dependencies = [ - "unicode-width", + "winapi-util", ] +[[package]] +name = "textwrap" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" + [[package]] name = "thiserror" version = "1.0.30" @@ -1622,12 +1616,6 @@ dependencies = [ "serde", ] -[[package]] -name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - [[package]] name = "unicode-width" version = "0.1.9" @@ -1646,17 +1634,11 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vswhom" @@ -1970,9 +1952,9 @@ dependencies = [ [[package]] name = "x11-clipboard" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b397ace6e980510de59a4fe3d4c758dffab231d6d747ce9fa1aba6b6035d5f32" +checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c" dependencies = [ "xcb", ] @@ -1990,12 +1972,13 @@ dependencies = [ [[package]] name = "xcb" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62056f63138b39116f82a540c983cc11f1c90cd70b3d492a70c25eaa50bd22a6" +checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c" dependencies = [ "libc", "log", + "quick-xml", ] [[package]] diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml index d64f3d3f..26523e1c 100644 --- a/alacritty/Cargo.toml +++ b/alacritty/Cargo.toml @@ -19,7 +19,7 @@ path = "../alacritty_config_derive" version = "0.1.0" [dependencies] -structopt = "0.3.22" +clap = { version = "3.0.0", features = ["derive"] } log = { version = "0.4", features = ["std", "serde"] } time = "0.1.40" fnv = "1" @@ -36,12 +36,12 @@ unicode-width = "0.1" bitflags = "1" dirs = "3.0.1" -[dev-dependencies] -clap = "2.33.3" - [build-dependencies] gl_generator = "0.14.0" +[dev-dependencies] +clap_complete = "3.0.0" + [target.'cfg(not(windows))'.dependencies] xdg = "2.4.0" diff --git a/alacritty/src/cli.rs b/alacritty/src/cli.rs index 4c8a307a..a53c6ef3 100644 --- a/alacritty/src/cli.rs +++ b/alacritty/src/cli.rs @@ -1,10 +1,12 @@ use std::cmp::max; use std::path::PathBuf; +#[cfg(unix)] +use clap::Subcommand; +use clap::{Args, Parser}; use log::{self, error, LevelFilter}; use serde::{Deserialize, Serialize}; use serde_yaml::Value; -use structopt::StructOpt; use alacritty_terminal::config::{Program, PtyConfig}; @@ -12,70 +14,70 @@ use crate::config::window::{Class, Identity, DEFAULT_NAME}; use crate::config::{serde_utils, UiConfig}; /// CLI options for the main Alacritty executable. -#[derive(StructOpt, Default, Debug)] -#[structopt(author, about, version = env!("VERSION"))] +#[derive(Parser, Default, Debug)] +#[clap(author, about, version = env!("VERSION"))] pub struct Options { /// Print all events to stdout. - #[structopt(long)] + #[clap(long)] pub print_events: bool, /// Generates ref test. - #[structopt(long)] + #[clap(long)] pub ref_test: bool, /// Defines the X11 window ID (as a decimal integer) to embed Alacritty within. - #[structopt(long)] + #[clap(long)] pub embed: Option, /// Specify alternative configuration file [default: $XDG_CONFIG_HOME/alacritty/alacritty.yml]. #[cfg(not(any(target_os = "macos", windows)))] - #[structopt(long)] + #[clap(long)] pub config_file: Option, /// Specify alternative configuration file [default: %APPDATA%\alacritty\alacritty.yml]. #[cfg(windows)] - #[structopt(long)] + #[clap(long)] pub config_file: Option, /// Specify alternative configuration file [default: $HOME/.config/alacritty/alacritty.yml]. #[cfg(target_os = "macos")] - #[structopt(long)] + #[clap(long)] pub config_file: Option, /// Path for IPC socket creation. #[cfg(unix)] - #[structopt(long)] + #[clap(long)] pub socket: Option, /// Reduces the level of verbosity (the min level is -qq). - #[structopt(short, conflicts_with("verbose"), parse(from_occurrences))] + #[clap(short, conflicts_with("verbose"), parse(from_occurrences))] quiet: u8, /// Increases the level of verbosity (the max level is -vvv). - #[structopt(short, conflicts_with("quiet"), parse(from_occurrences))] + #[clap(short, conflicts_with("quiet"), parse(from_occurrences))] verbose: u8, /// Override configuration file options [example: cursor.style=Beam]. - #[structopt(short = "o", long)] + #[clap(short = 'o', long, multiple_values = true)] option: Vec, /// CLI options for config overrides. - #[structopt(skip)] + #[clap(skip)] pub config_options: Value, - /// Options which could be passed via IPC. - #[structopt(flatten)] + /// Options which can be passed via IPC. + #[clap(flatten)] pub window_options: WindowOptions, /// Subcommand passed to the CLI. #[cfg(unix)] - #[structopt(subcommand)] + #[clap(subcommand)] pub subcommands: Option, } impl Options { pub fn new() -> Self { - let mut options = Self::from_args(); + let mut options = Self::parse(); // Convert `--option` flags into serde `Value`. for option in &options.option { @@ -172,18 +174,18 @@ fn parse_class(input: &str) -> Result { } /// Terminal specific cli options which can be passed to new windows via IPC. -#[derive(Serialize, Deserialize, StructOpt, Default, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Args, Default, Debug, Clone, PartialEq)] pub struct TerminalOptions { /// Start the shell in the specified working directory. - #[structopt(long)] + #[clap(long)] pub working_directory: Option, /// Remain open after child process exit. - #[structopt(long)] + #[clap(long)] pub hold: bool, /// Command and args to execute (must be last argument). - #[structopt(short = "e", long, allow_hyphen_values = true)] + #[clap(short = 'e', long, allow_hyphen_values = true, multiple_values = true)] command: Vec, } @@ -223,14 +225,14 @@ impl From for PtyConfig { } /// Window specific cli options which can be passed to new windows via IPC. -#[derive(Serialize, Deserialize, StructOpt, Default, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Args, Default, Debug, Clone, PartialEq)] pub struct WindowIdentity { /// Defines the window title [default: Alacritty]. - #[structopt(short, long)] + #[clap(short, long)] pub title: Option, /// Defines window class/app_id on X11/Wayland [default: Alacritty]. - #[structopt(long, value_name = "instance> | ,, } @@ -248,40 +250,40 @@ impl WindowIdentity { /// Available CLI subcommands. #[cfg(unix)] -#[derive(StructOpt, Debug)] +#[derive(Subcommand, Debug)] pub enum Subcommands { Msg(MessageOptions), } /// Send a message to the Alacritty socket. #[cfg(unix)] -#[derive(StructOpt, Debug)] +#[derive(Args, Debug)] pub struct MessageOptions { /// IPC socket connection path override. - #[structopt(long, short)] + #[clap(long, short)] pub socket: Option, /// Message which should be sent. - #[structopt(subcommand)] + #[clap(subcommand)] pub message: SocketMessage, } /// Available socket messages. #[cfg(unix)] -#[derive(StructOpt, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Subcommand, Serialize, Deserialize, Debug, Clone, PartialEq)] pub enum SocketMessage { /// Create a new window in the same Alacritty process. CreateWindow(WindowOptions), } /// Subset of options that we pass to a 'create-window' subcommand. -#[derive(StructOpt, Serialize, Deserialize, Default, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Args, Default, Clone, Debug, PartialEq)] pub struct WindowOptions { /// Terminal options which can be passed via IPC. - #[structopt(flatten)] + #[clap(flatten)] pub terminal_options: TerminalOptions, - #[structopt(flatten)] + #[clap(flatten)] /// Window options which could be passed via IPC. pub window_identity: WindowIdentity, } @@ -296,7 +298,9 @@ mod tests { use std::io::Read; #[cfg(target_os = "linux")] - use clap::Shell; + use clap::IntoApp; + #[cfg(target_os = "linux")] + use clap_complete::Shell; use serde_yaml::mapping::Mapping; #[test] @@ -392,7 +396,7 @@ mod tests { #[cfg(target_os = "linux")] #[test] fn completions() { - let mut clap = Options::clap(); + let mut clap = Options::into_app(); for (shell, file) in &[ (Shell::Bash, "alacritty.bash"), @@ -400,7 +404,7 @@ mod tests { (Shell::Zsh, "_alacritty"), ] { let mut generated = Vec::new(); - clap.gen_completions_to("alacritty", *shell, &mut generated); + clap_complete::generate(*shell, &mut clap, "alacritty", &mut generated); let generated = String::from_utf8_lossy(&generated); let mut completion = String::new(); @@ -412,8 +416,11 @@ mod tests { // NOTE: Use this to generate new completions. // - // clap.gen_completions("alacritty", Shell::Bash, "../extra/completions/"); - // clap.gen_completions("alacritty", Shell::Fish, "../extra/completions/"); - // clap.gen_completions("alacritty", Shell::Zsh, "../extra/completions/"); + // let mut file = File::create("../extra/completions/alacritty.bash").unwrap(); + // clap_complete::generate(Shell::Bash, &mut clap, "alacritty", &mut file); + // let mut file = File::create("../extra/completions/alacritty.fish").unwrap(); + // clap_complete::generate(Shell::Fish, &mut clap, "alacritty", &mut file); + // let mut file = File::create("../extra/completions/_alacritty").unwrap(); + // clap_complete::generate(Shell::Zsh, &mut clap, "alacritty", &mut file); } } diff --git a/extra/completions/_alacritty b/extra/completions/_alacritty index ad93e6bc..4f482236 100644 --- a/extra/completions/_alacritty +++ b/extra/completions/_alacritty @@ -15,26 +15,26 @@ _alacritty() { local context curcontext="$curcontext" state line _arguments "${_arguments_options[@]}" \ -'--embed=[Defines the X11 window ID (as a decimal integer) to embed Alacritty within]' \ -'--config-file=[Specify alternative configuration file \[default: $XDG_CONFIG_HOME/alacritty/alacritty.yml\]]' \ -'--socket=[Path for IPC socket creation]' \ -'*-o+[Override configuration file options \[example: cursor.style=Beam\]]' \ -'*--option=[Override configuration file options \[example: cursor.style=Beam\]]' \ -'--working-directory=[Start the shell in the specified working directory]' \ -'*-e+[Command and args to execute (must be last argument)]' \ -'*--command=[Command and args to execute (must be last argument)]' \ -'-t+[Defines the window title \[default: Alacritty\]]' \ -'--title=[Defines the window title \[default: Alacritty\]]' \ -'--class=[Defines window class/app_id on X11/Wayland \[default: Alacritty\]]' \ +'--embed=[Defines the X11 window ID (as a decimal integer) to embed Alacritty within]:EMBED: ' \ +'--config-file=[Specify alternative configuration file \[default: $XDG_CONFIG_HOME/alacritty/alacritty.yml\]]:CONFIG_FILE: ' \ +'--socket=[Path for IPC socket creation]:SOCKET: ' \ +'*-o+[Override configuration file options \[example: cursor.style=Beam\]]:OPTION: ' \ +'*--option=[Override configuration file options \[example: cursor.style=Beam\]]:OPTION: ' \ +'--working-directory=[Start the shell in the specified working directory]:WORKING_DIRECTORY: ' \ +'*-e+[Command and args to execute (must be last argument)]:COMMAND: ' \ +'*--command=[Command and args to execute (must be last argument)]:COMMAND: ' \ +'-t+[Defines the window title \[default: Alacritty\]]:TITLE: ' \ +'--title=[Defines the window title \[default: Alacritty\]]:TITLE: ' \ +'--class=[Defines window class/app_id on X11/Wayland \[default: Alacritty\]]:instance> | ,alacritty" \ && ret=0 @@ -46,16 +46,15 @@ _alacritty() { case $line[1] in (msg) _arguments "${_arguments_options[@]}" \ -'-s+[IPC socket connection path override]' \ -'--socket=[IPC socket connection path override]' \ -'-h[Prints help information]' \ -'--help[Prints help information]' \ -'-V[Prints version information]' \ -'--version[Prints version information]' \ +'-s+[IPC socket connection path override]:SOCKET: ' \ +'--socket=[IPC socket connection path override]:SOCKET: ' \ +'-h[Print help information]' \ +'--help[Print help information]' \ ":: :_alacritty__msg_commands" \ "*::: :->msg" \ && ret=0 -case $state in + + case $state in (msg) words=($line[1] "${words[@]}") (( CURRENT += 1 )) @@ -63,25 +62,23 @@ case $state in case $line[1] in (create-window) _arguments "${_arguments_options[@]}" \ -'--working-directory=[Start the shell in the specified working directory]' \ -'*-e+[Command and args to execute (must be last argument)]' \ -'*--command=[Command and args to execute (must be last argument)]' \ -'-t+[Defines the window title \[default: Alacritty\]]' \ -'--title=[Defines the window title \[default: Alacritty\]]' \ -'--class=[Defines window class/app_id on X11/Wayland \[default: Alacritty\]]' \ +'--working-directory=[Start the shell in the specified working directory]:WORKING_DIRECTORY: ' \ +'*-e+[Command and args to execute (must be last argument)]:COMMAND: ' \ +'*--command=[Command and args to execute (must be last argument)]:COMMAND: ' \ +'-t+[Defines the window title \[default: Alacritty\]]:TITLE: ' \ +'--title=[Defines the window title \[default: Alacritty\]]:TITLE: ' \ +'--class=[Defines window class/app_id on X11/Wayland \[default: Alacritty\]]:instance> | ,