summaryrefslogtreecommitdiff
path: root/Meta
diff options
context:
space:
mode:
authorkleines Filmröllchen <filmroellchen@serenityos.org>2023-05-10 22:01:16 +0200
committerJelle Raaijmakers <jelle@gmta.nl>2023-05-17 12:55:15 +0200
commit418f1f82e7d122ac0a3205643c1a054caab3d25f (patch)
treefcf76333b467d2265cc85e52dfcf9af1c0233864 /Meta
parentef7afd833154e9cd71759a15ccea12b8a3b0a4ca (diff)
downloadserenity-418f1f82e7d122ac0a3205643c1a054caab3d25f.zip
Meta/ShellCompletions: Add toolchain completion
This is very convenient for anyone like me who regularly runs the Clang toolchain. The toolchain is not completed for Lagom and the toolchain-independent help command.
Diffstat (limited to 'Meta')
-rw-r--r--Meta/ShellCompletions/zsh/_serenity16
1 files changed, 16 insertions, 0 deletions
diff --git a/Meta/ShellCompletions/zsh/_serenity b/Meta/ShellCompletions/zsh/_serenity
index f23c3126fb..b18c2bc692 100644
--- a/Meta/ShellCompletions/zsh/_serenity
+++ b/Meta/ShellCompletions/zsh/_serenity
@@ -5,6 +5,7 @@ _serenity() {
args=(
'1:command:->commands'
'2:target:->targets'
+ '3:toolchain:->toolchains'
'*:: :->args'
)
@@ -34,6 +35,12 @@ _serenity() {
'lagom:Target host machine'
)
+ local toolchains
+ toolchains=(
+ 'GNU:Toolchain gcc or $SERENITY_TOOLCHAIN (default)'
+ 'Clang:Toolchain clang'
+ )
+
_arguments -C -S "$args[@]"
local command
@@ -42,6 +49,9 @@ _serenity() {
local target
target="$line[2]"
+ local toolchain
+ toolchain="$line[3]"
+
case "$state" in
commands)
_describe 'command' commands
@@ -59,6 +69,12 @@ _serenity() {
esac
_describe 'target' targets
;;
+ toolchains)
+ if [[ "$command" != help && "$target" != lagom ]]; then
+ # Toolchain-dependent invocations.
+ _describe 'toolchain' toolchains
+ fi
+ ;;
args)
;;
esac