Commit Graph

11 Commits

Author SHA1 Message Date
Hadi Moshayedi
fc135c456d Speed-up bash target auto-complete.
These speed-ups include:

* Let compgen do the command substitution. Similar to
  https://lists.gnu.org/archive/html/bug-bash/2012-03/msg00115.html
* Use "cut" instead of "awk" for separating fields.
2015-10-31 06:13:33 -04:00
Elan Ruusamäe
6fc15c47a0 no subshell
don't need subshell to send stderr to /dev/null
2014-11-23 12:35:03 -08:00
Taylor Braun-Jones
b1d4668260 Fix getopts barfing over the terminal when trying to complete -f and -C
Note that this is only applicable for when bash_completion is
unavailable.
2014-04-30 14:39:04 -04:00
Taylor Braun-Jones
4f9ac2aab9 Support completion of arguments to -f and -C options
Note: This is only available for bash_completion users.
2014-04-30 14:37:47 -04:00
Taylor Braun-Jones
43645ff15b Style: Fix inconsistent indentation 2014-04-25 13:59:53 -04:00
Taylor Braun-Jones
28d64afc72 Fix bash-completion support for -C option to expand tilde 2014-04-25 13:50:09 -04:00
Allan Odgaard
4835a2b195 Expand the -C argument via ‘eval’ in bash completion
Previously completion would not work for ‘ninja -C $HOME/Source/foo targ‸’.

We still do not support using tilde in the directory argument.
2014-04-15 14:28:42 +07:00
Allan Odgaard
1f38478eb9 Fix bash completion when using command options
By quoting the ‘line’ variable we are making it a single word, but ‘getopts’ wants each option as its own word.

Previously bash completion would output an error for a line like: ‘ninja -vn targ‸’.

In addition to removing the quotes (to enable word expansion) I also used it as a regular variable, as that is what it is (not an array).
2014-04-15 14:27:57 +07:00
Guilherme Bufolo
ca04327e24 Improved bash completion when using tools like '-t clean' 2013-04-06 13:47:18 +02:00
Tommy Nyquist
e6c67528e8 Add support for reading directory for bash completion.
Currently ninja bash completion only works in the directory where the
build.ninja files is located. This adds support for using the -C
argument to ninja.
2012-10-30 15:28:02 -07:00
Evan Martin
71626dde2c add bash completion based on zsh completion 2011-12-27 23:32:09 -08:00