Commit Graph

38 Commits

Author SHA1 Message Date
David Adam
4d588a24e9 complete: recognise -w short option for --wraps
Closes #1793.
2014-11-04 23:33:31 +08:00
Kevin Ballard
2820c7a9cd Erase all completions with complete -c foo -e
When passing `-e` to `complete -c foo` without any other options, all
options for the command should be erased.

Fixes #380.
2014-09-02 15:30:58 -07:00
Kevin Ballard
edd4f3d5ad Don't erase old-style options with complete -l foo -e
When erasing long option completions, distinguish between gnu-style and
old-style options, just like we do when adding and printing completions.
2014-09-02 15:30:58 -07:00
ridiculousfish
06400b83b1 Support for command wrapping ("aliases")
Add the --wraps option to 'complete' and 'function'. This allows a
command to (recursively) inherit the completions of a wrapped command.
Fixes #393.

When evaluating a completion, we inspect the entire "wrap chain" for a
command, i.e. we follow the sequence of wrapping until we either hit a
loop (which we silently ignore) or the end of the chain. We then
evaluate completions as if the wrapping command were substituted with
the wrapped command. Currently this only works for commands, i.e.
'complete --command gco --wraps git\ checkout' won't work (that would
seem to encroaching on abbreviations anyways). It might be useful to
show an error message for that case.

The commandline builtin reflects the commandline with the wrapped
command substituted in, so e.g. git completions (which inspect the
command line) will just work. This sort of command line munging is
also performed by 'complete -C' so it's not totally without precedent.

'alias will also now mark its generated function as wrapping the
'target.
2014-08-15 18:14:36 -07:00
ridiculousfish
5e60efefbf Allow parse_util_detect_errors to treat incomplete strings as errors
Fixes bug where sourcing a file with an unclosed quote would not have a
backtrace
2014-07-24 14:41:15 -07:00
ridiculousfish
0d3169ef70 Run restyle.sh to enforce style rules. 2014-03-31 10:01:39 -07:00
ridiculousfish
e5ef45e4c0 Rewrite parser_t::test_args and parser_t::eval_args to use new parser 2014-03-20 21:32:02 -07:00
ridiculousfish
be33d3f2a4 Revert "Merge pull request #1317 from pullreq/cpp"
This reverts commit 74135c0600, reversing
changes made to 6d749789ce.

See discussion in #1317
2014-02-28 02:16:48 -08:00
Geoff Nixon
18dd6f58e3 Fixes .c -> .cpp in comments. For doxygen. 2014-02-27 06:23:40 -08:00
ridiculousfish
7e769252e7 Make builtin_complete output escaped completions. Fixes #1127 2014-02-04 11:55:56 -08:00
ridiculousfish
89069fdaa4 Miscellaneous minor fixes based on cppcheck static analyzer 2014-01-12 13:33:35 -08:00
ridiculousfish
5b24aac266 Initial work on backtrace support with new parser 2013-12-15 16:05:37 -08:00
ridiculousfish
5cf59de676 Finish rewriting detect_errors to use new parser. All tests now pass (!) 2013-12-12 18:18:07 -08:00
ridiculousfish
925fe65dd8 Remove the indentation part of parser_t::test(). Rename it to
detect_errors().
2013-12-08 16:25:07 -08:00
ridiculousfish
9f6223311e Large cleanup and refactoring of unescape() function. 2013-11-24 22:58:39 -08:00
ridiculousfish
4d19bb17a9 Break out COMPLETE_NO_CASE and COMPLETE_REPLACES_TOKEN into separate flags, in preparation for upcoming fuzzy completion work 2013-03-05 20:54:16 -08:00
ridiculousfish
6d522e6ed6 First round of fixes based on cppcheck
https://github.com/fish-shell/fish-shell/issues/575
2013-02-16 00:02:40 -08:00
ridiculousfish
92b2376c23 Indent switch + case properly. https://github.com/fish-shell/fish-shell/issues/530 2013-01-24 14:59:52 -08:00
ridiculousfish
26678682ca Fix indentation of switch statements 2012-11-19 00:31:03 -08:00
ridiculousfish
9992b8eb0e Apply new indentation, brace, and whitespace style 2012-11-18 16:30:30 -08:00
Łukasz Niemier
47df1ae40a Remove trailing whitespaces and change tabs to spaces 2012-11-18 11:23:22 +01:00
ridiculousfish
294fbc8309 Replaced some calls to unescape with unescape_string 2012-05-09 02:55:36 -07:00
ridiculousfish
3553e65089 Add some more locking and const correctness to completion_entry_t in preparation for supporting better multithreading 2012-02-26 14:32:06 -08:00
ridiculousfish
ad7c5886bc Fix a crash in complete -C 2012-02-26 13:46:21 -08:00
ridiculousfish
a515db4aea Some work to allow completions to be evaluated off of the main thread 2012-02-24 12:19:31 -08:00
ridiculousfish
62bd43f17f Large set of changes to migrate sb_out and sb_err to wcstring 2012-02-22 10:51:06 -08:00
ridiculousfish
5fe7c065dc Squash a bunch of leaks 2012-02-21 19:33:11 -08:00
Siteshwar Vashisht
6e58c9f7c8 Switched to std::map instead of hash_table_t in env.cpp and env_universal_common.cpp. 2012-02-18 00:25:29 +05:30
ridiculousfish
063fc0c48b Cleanup al_list from builtin_complete.cpp 2012-02-08 00:45:07 -08:00
ridiculousfish
c0e783eb6e Excised some halloc 2012-02-07 21:23:12 -08:00
ridiculousfish
a534c397f5 Const correctness changes 2012-02-06 00:57:43 -08:00
ridiculousfish
5ad6849d4e Work on new history implementation 2012-02-05 16:42:24 -08:00
ridiculousfish
3b8a4e56b0 A bunch of work to move towards a sane memory model in job_t 2012-01-29 22:06:58 -08:00
Siteshwar Vashisht
1a5d866a91 buggy-auto-complete is not so buggy now. Merged branch 'buggy-auto-complete' into CPlusPlus 2012-01-29 14:11:39 +05:30
ridiculousfish
fa796d668f Get some basic function signatures right for new instanced parser 2012-01-16 12:10:08 -08:00
Siteshwar Vashisht
140ead65b6 Converted all auto completion calls (on pressing tab) to use std::vector<completion_t>, bugs are yet to be fixed 2012-01-16 22:26:47 +05:30
ridiculousfish
8d2f107d61 Some changes to migrate towards C++ and a multithreaded model 2011-12-26 19:18:46 -08:00
ridiculousfish
3f16ace678 Initial C++ conversion 2011-12-26 19:11:54 -08:00