aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin_complete.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-18 14:14:32 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-20 21:32:02 -0700
commite5ef45e4c04b6126ea74c4010b2d8fe1c0b06cca (patch)
treed200c10a700c9cfae10d170a600acfda8508086a /builtin_complete.cpp
parente780637cf42bc8d26e0e963f5ff84b11007459c5 (diff)
Rewrite parser_t::test_args and parser_t::eval_args to use new parser
Diffstat (limited to 'builtin_complete.cpp')
-rw-r--r--builtin_complete.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/builtin_complete.cpp b/builtin_complete.cpp
index 6e395f94..c2fb6637 100644
--- a/builtin_complete.cpp
+++ b/builtin_complete.cpp
@@ -467,15 +467,22 @@ static int builtin_complete(parser_t &parser, wchar_t **argv)
{
if (comp && wcslen(comp))
{
- if (parser.test_args(comp, 0, 0))
+ wcstring prefix;
+ if (argv[0])
+ {
+ prefix.append(argv[0]);
+ prefix.append(L": ");
+ }
+
+ wcstring err_text;
+ if (parser.detect_errors_in_argument_list(comp, &err_text, prefix.c_str()))
{
append_format(stderr_buffer,
L"%ls: Completion '%ls' contained a syntax error\n",
argv[0],
comp);
-
- parser.test_args(comp, &stderr_buffer, argv[0]);
-
+ stderr_buffer.append(err_text);
+ stderr_buffer.push_back(L'\n');
res = true;
}
}