diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-04-20 23:00:54 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-04-26 15:02:22 -0700 |
commit | 1f06e5f0b9ee483053b987c9cab9f1f5fce2590c (patch) | |
tree | 8ebebff055f4aa184e7d7b021190ab01d9376992 /src/builtin.cpp | |
parent | daa217f533490e0b9bc4113a143e8f38de922b7a (diff) |
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
Diffstat (limited to 'src/builtin.cpp')
-rw-r--r-- | src/builtin.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
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 <assert.h> #include <errno.h> #include <fcntl.h> -#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -31,12 +29,13 @@ #include <wctype.h> #include <algorithm> #include <map> -#include <stack> #include <string> #include <utility> +#include <limits.h> +#include <memory> // IWYU pragma: keep +#include <stdbool.h> #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); } |