From: Philippe Proulx Date: Wed, 30 Aug 2023 16:33:13 +0000 (-0400) Subject: Add Zsh completion files for public LTTng CLI commands X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=76bcac588cf4812f6a429ff81734910a0fcb4f64;hp=76bcac588cf4812f6a429ff81734910a0fcb4f64;p=lttng-tools.git Add Zsh completion files for public LTTng CLI commands Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh. Zsh features a powerful completion system which makes it possible to improve the interactive user experience greatly when using an LTTng command. Those four new files are Very Sophisticated Zsh completion files, especially `extras/zsh-completion/_lttng`. Notable features for all commands: * Support of LTTng 2.5 through LTTng 2.14, with version-specific completion. Set `LTTNG_ZSH_COMP_IGNORE_VERSION_LIMIT=1` to disable the upper limit of the version check. This should be safe most of the time, but if there's a breaking change in option/argument interaction, the completions might be wrong. * Exclusion of options and arguments depending on the current options and arguments, according to the manual pages. For example, for `lttng enable-channel`, you cannot specify `--buffers-uid` if you already specified `--kernel` (and vice versa). Notable features for the `lttng` command: * Full support, except for the condition and action specifiers of the `add-trigger` subcommand: although I may now add "skillful in Zsh completion" to my resume, the positional design of `--condition` and `--action` needs event more spicy Zsh wizardry which I didn't explore yet. * Custom tags and support for the `verbose` style to customize the completion behaviour and look with `zstyle`. * For any dynamic completion (relying on some output of the `lttng` command), connect to the right session daemon depending on the selected tracing group (`g`/`--group`). * User/group ID completion with displayed corresponding Unix user/group names. * Dynamic recording session name completion with a summary of properties (activity and mode). Only the relevant ones are added to the completion set. For example, names of active sessions are not part of the completion set for `lttng start`. * Current recording session taken into account for subcommands needing one when you don't specify the dedicated recording session option/argument. * Dynamic channel name completion depending on the selected recording session and tracing domain, with a summary of properties (status, tracing domain, event record loss mode). Only the relevant ones are added to the completion set. For example, names of enabled channels are not part of the completion set for `lttng enable-channel`. * Dynamic recording event rule name condition completion for `lttng disable-event`. * Dynamic instrumentation point name completion depending on the selected tracing domain * Dynamic context field type completion depending on the selected tracing domain. * Log level name completion depending on the selected tracing domain. * Dynamic trigger name completion depending on the selected owner user ID. Notable features for the `lttng-sessiond` command: * LTTng kernel probe module name completion (checks within the `/usr/lib/modules` directory). Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau Change-Id: If8c2c58a50664f41ecc41ab1df72879127d1cd02 ---