From 1f06e5f0b9ee483053b987c9cab9f1f5fce2590c Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Wed, 20 Apr 2016 23:00:54 -0700 Subject: add better support for IWYU and fix things Remove the "make iwyu" build target. Move the functionality into the recently introduced lint.fish script. Fix a lot, but not all, of the include-what-you-use errors. Specifically, it fixes all of the IWYU errors on my OS X server but only removes some of them on my Ubuntu 14.04 server. Fixes #2957 --- src/builtin.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/builtin.cpp') diff --git a/src/builtin.cpp b/src/builtin.cpp index a2bf6736..b7a84c69 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -15,12 +15,10 @@ // Check the other builtin manuals for proper syntax. // // 4). Use 'git add doc_src/NAME.txt' to start tracking changes to the documentation file. -#include "config.h" // IWYU pragma: keep #include #include #include -#include #include #include #include @@ -31,12 +29,13 @@ #include #include #include -#include #include #include +#include +#include // IWYU pragma: keep +#include #include "fallback.h" // IWYU pragma: keep - #include "builtin.h" #include "complete.h" #include "env.h" @@ -49,7 +48,6 @@ #include "input.h" #include "intern.h" #include "parse_constants.h" -#include "parse_tree.h" #include "parse_util.h" #include "parser.h" #include "parser_keywords.h" @@ -61,6 +59,8 @@ #include "wcstringutil.h" #include "wgetopt.h" #include "wutil.h" +#include "common.h" +#include "io.h" // The default prompt for the read command. #define DEFAULT_READ_PROMPT L"set_color green; echo -n read; set_color normal; echo -n \"> \"" @@ -103,7 +103,7 @@ int builtin_count_args(const wchar_t *const *argv) { /// This function works like wperror, but it prints its result into the streams.err string instead /// to stderr. Used by the builtin commands. -static void builtin_wperror(const wchar_t *s, io_streams_t &streams) { +void builtin_wperror(const wchar_t *s, io_streams_t &streams) { char *err = strerror(errno); if (s != NULL) { streams.err.append(s); @@ -228,15 +228,15 @@ void builtin_print_help(parser_t &parser, io_streams_t &streams, const wchar_t * } /// Perform error reporting for encounter with unknown option. -static void builtin_unknown_option(parser_t &parser, io_streams_t &streams, const wchar_t *cmd, - const wchar_t *opt) { +void builtin_unknown_option(parser_t &parser, io_streams_t &streams, const wchar_t *cmd, + const wchar_t *opt) { streams.err.append_format(BUILTIN_ERR_UNKNOWN, cmd, opt); builtin_print_help(parser, streams, cmd, streams.err); } /// Perform error reporting for encounter with missing argument. -static void builtin_missing_argument(parser_t &parser, io_streams_t &streams, const wchar_t *cmd, - const wchar_t *opt) { +void builtin_missing_argument(parser_t &parser, io_streams_t &streams, const wchar_t *cmd, + const wchar_t *opt) { streams.err.append_format(BUILTIN_ERR_MISSING, cmd, opt); builtin_print_help(parser, streams, cmd, streams.err); } -- cgit v1.2.3