summaryrefslogtreecommitdiff
path: root/ninja/misc/zsh-completion
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-05-22 18:24:25 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-06-04 16:32:40 +0200
commit4ce69f7403811819800e7c5ae1318b2647e778d1 (patch)
tree2ec3a98b5abef002670a0916354eb7e0abfe2aa2 /ninja/misc/zsh-completion
parenta6dd70e0328d155d5df8d6df48afbab690b08fb6 (diff)
downloadqtwebengine-chromium-4ce69f7403811819800e7c5ae1318b2647e778d1.tar.gz
Update Chromium snapshot to stable version 33.0.1750.170
This is meant as a baseline commit hence it does not include the patches we need to apply for QtWebEngine. All patches should be rebased on top of this commit so we can get rid of the external patches directory. In future these baseline commits always have to include the exact Chromium version returned by version_resolver.py's currentVersion() in their first line, so that we can retrieve the patches on top to apply on the upstream repository. This also includes a ninja update. Change-Id: I60abeadb785a3b7d149c58b65ddb5a823fed3083 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'ninja/misc/zsh-completion')
-rw-r--r--ninja/misc/zsh-completion47
1 files changed, 44 insertions, 3 deletions
diff --git a/ninja/misc/zsh-completion b/ninja/misc/zsh-completion
index cd0edfbd97a..2fe16fb0499 100644
--- a/ninja/misc/zsh-completion
+++ b/ninja/misc/zsh-completion
@@ -1,3 +1,4 @@
+#compdef ninja
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,7 +16,47 @@
# Add the following to your .zshrc to tab-complete ninja targets
# . path/to/ninja/misc/zsh-completion
-_ninja() {
- reply=(`(ninja -t targets all 2&>/dev/null) | awk -F: '{print $1}'`)
+__get_targets() {
+ ninja -t targets 2>/dev/null | while read -r a b; do echo $a | cut -d ':' -f1; done;
}
-compctl -K _ninja ninja
+
+__get_tools() {
+ ninja -t list 2>/dev/null | while read -r a b; do echo $a; done | tail -n +2
+}
+
+__get_modes() {
+ ninja -d list 2>/dev/null | while read -r a b; do echo $a; done | tail -n +2 | head -n -1
+}
+
+__modes() {
+ local -a modes
+ modes=(${(fo)"$(__get_modes)"})
+ _describe 'modes' modes
+}
+
+__tools() {
+ local -a tools
+ tools=(${(fo)"$(__get_tools)"})
+ _describe 'tools' tools
+}
+
+__targets() {
+ local -a targets
+ targets=(${(fo)"$(__get_targets)"})
+ _describe 'targets' targets
+}
+
+_arguments \
+ {-h,--help}'[Show help]' \
+ '--version[Print ninja version]' \
+ '-C+[Change to directory before doing anything else]:directories:_directories' \
+ '-f+[Specify input build file (default=build.ninja)]:files:_files' \
+ '-j+[Run N jobs in parallel (default=number of CPUs available)]:number of jobs' \
+ '-l+[Do not start new jobs if the load average is greater than N]:number of jobs' \
+ '-k+[Keep going until N jobs fail (default=1)]:number of jobs' \
+ '-n[Dry run (do not run commands but act like they succeeded)]' \
+ '-v[Show all command lines while building]' \
+ '-d+[Enable debugging (use -d list to list modes)]:modes:__modes' \
+ '-t+[Run a subtool (use -t list to list subtools)]:tools:__tools' \
+ '*::targets:__targets'
+