Let's make src/ easier to grok, move builins to src/builtins

+ No functional change here, just renames and #include changes.
+ CMake can't have slashes in the target names. I'm suspciious of
  that weird machinery for test, but I made it work.
+ A couple of builtins did not include their own headers, that
  is no longer the case.
This commit is contained in:
Aaron Gyes 2021-11-09 17:07:15 -08:00
parent 4cad079aeb
commit eb990c07c8
78 changed files with 460 additions and 454 deletions

View file

@ -57,9 +57,9 @@ add_definitions(-UNDEBUG)
source_group("CMake Rules" REGULAR_EXPRESSION "^$")
# Put source and header files at top level under targets.
source_group("Source Files" REGULAR_EXPRESSION "^$")
source_group("Header Files" REGULAR_EXPRESSION "^$")
source_group("Builtins" REGULAR_EXPRESSION "builtin_.*")
source_group("Source Files" REGULAR_EXPRESSION ".*\\.cpp")
source_group("Header Files" REGULAR_EXPRESSION ".*\\.h")
source_group("Builtins" "builtins/")
# Support folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@ -85,19 +85,19 @@ endif()
# All objects that the system needs to build fish, except fish.cpp
set(FISH_SRCS
src/ast.cpp src/autoload.cpp src/builtin.cpp src/builtin_argparse.cpp
src/builtin_bg.cpp src/builtin_bind.cpp src/builtin_block.cpp
src/builtin_builtin.cpp src/builtin_cd.cpp src/builtin_command.cpp
src/builtin_commandline.cpp src/builtin_complete.cpp src/builtin_contains.cpp
src/builtin_disown.cpp src/builtin_echo.cpp src/builtin_emit.cpp
src/builtin_eval.cpp src/builtin_exit.cpp src/builtin_fg.cpp
src/builtin_function.cpp src/builtin_functions.cpp src/builtin_history.cpp
src/builtin_jobs.cpp src/builtin_math.cpp src/builtin_printf.cpp
src/builtin_pwd.cpp src/builtin_random.cpp src/builtin_read.cpp
src/builtin_realpath.cpp src/builtin_return.cpp src/builtin_set.cpp
src/builtin_set_color.cpp src/builtin_source.cpp src/builtin_status.cpp
src/builtin_string.cpp src/builtin_test.cpp src/builtin_type.cpp src/builtin_ulimit.cpp
src/builtin_wait.cpp src/color.cpp src/common.cpp src/complete.cpp src/env.cpp
src/ast.cpp src/autoload.cpp src/builtin.cpp src/builtins/argparse.cpp
src/builtins/bg.cpp src/builtins/bind.cpp src/builtins/block.cpp
src/builtins/builtin.cpp src/builtins/cd.cpp src/builtins/command.cpp
src/builtins/commandline.cpp src/builtins/complete.cpp src/builtins/contains.cpp
src/builtins/disown.cpp src/builtins/echo.cpp src/builtins/emit.cpp
src/builtins/eval.cpp src/builtins/exit.cpp src/builtins/fg.cpp
src/builtins/function.cpp src/builtins/functions.cpp src/builtins/history.cpp
src/builtins/jobs.cpp src/builtins/math.cpp src/builtins/printf.cpp
src/builtins/pwd.cpp src/builtins/random.cpp src/builtins/read.cpp
src/builtins/realpath.cpp src/builtins/return.cpp src/builtins/set.cpp
src/builtins/set_color.cpp src/builtins/source.cpp src/builtins/status.cpp
src/builtins/string.cpp src/builtins/test.cpp src/builtins/type.cpp src/builtins/ulimit.cpp
src/builtins/wait.cpp src/color.cpp src/common.cpp src/complete.cpp src/env.cpp
src/env_dispatch.cpp src/env_universal_common.cpp src/event.cpp src/exec.cpp
src/expand.cpp src/fallback.cpp src/fd_monitor.cpp src/fish_version.cpp
src/flog.cpp src/function.cpp src/future_feature_flags.cpp src/highlight.cpp

View file

@ -107,11 +107,9 @@ set(CMAKE_XCODE_GENERATE_SCHEME 0)
# and the only dependency a test can have is on another test. So we make building fish and
# `fish_tests` prerequisites to our entire top-level `test` target.
function(add_test_target NAME)
add_custom_target("test_${NAME}"
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R "^${NAME}$$"
DEPENDS fish_tests tests_buildroot_target
USES_TERMINAL
)
string(REPLACE "/" "-" NAME ${NAME})
add_custom_target("test_${NAME}" COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R "^${NAME}$$"
DEPENDS fish_tests tests_buildroot_target USES_TERMINAL )
endfunction()
add_custom_target(tests_buildroot_target

View file

@ -30,41 +30,41 @@
#include <memory>
#include <string>
#include "builtin_argparse.h"
#include "builtin_bg.h"
#include "builtin_bind.h"
#include "builtin_block.h"
#include "builtin_builtin.h"
#include "builtin_cd.h"
#include "builtin_command.h"
#include "builtin_commandline.h"
#include "builtin_complete.h"
#include "builtin_contains.h"
#include "builtin_disown.h"
#include "builtin_echo.h"
#include "builtin_emit.h"
#include "builtin_eval.h"
#include "builtin_exit.h"
#include "builtin_fg.h"
#include "builtin_functions.h"
#include "builtin_history.h"
#include "builtin_jobs.h"
#include "builtin_math.h"
#include "builtin_printf.h"
#include "builtin_pwd.h"
#include "builtin_random.h"
#include "builtin_read.h"
#include "builtin_realpath.h"
#include "builtin_return.h"
#include "builtin_set.h"
#include "builtin_set_color.h"
#include "builtin_source.h"
#include "builtin_status.h"
#include "builtin_string.h"
#include "builtin_test.h"
#include "builtin_type.h"
#include "builtin_ulimit.h"
#include "builtin_wait.h"
#include "builtins/argparse.h"
#include "builtins/bg.h"
#include "builtins/bind.h"
#include "builtins/block.h"
#include "builtins/builtin.h"
#include "builtins/cd.h"
#include "builtins/command.h"
#include "builtins/commandline.h"
#include "builtins/complete.h"
#include "builtins/contains.h"
#include "builtins/disown.h"
#include "builtins/echo.h"
#include "builtins/emit.h"
#include "builtins/eval.h"
#include "builtins/exit.h"
#include "builtins/fg.h"
#include "builtins/functions.h"
#include "builtins/history.h"
#include "builtins/jobs.h"
#include "builtins/math.h"
#include "builtins/printf.h"
#include "builtins/pwd.h"
#include "builtins/random.h"
#include "builtins/read.h"
#include "builtins/realpath.h"
#include "builtins/return.h"
#include "builtins/set.h"
#include "builtins/set_color.h"
#include "builtins/source.h"
#include "builtins/status.h"
#include "builtins/string.h"
#include "builtins/test.h"
#include "builtins/type.h"
#include "builtins/ulimit.h"
#include "builtins/wait.h"
#include "common.h"
#include "complete.h"
#include "exec.h"

View file

@ -3,7 +3,7 @@
// See issue #4190 for the rationale behind the original behavior of this builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_argparse.h"
#include "argparse.h"
#include <algorithm>
#include <cerrno>
@ -16,16 +16,16 @@
#include <utility>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "env.h"
#include "exec.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "wcstringutil.h"
#include "wgetopt.h" // IWYU pragma: keep
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../env.h"
#include "../exec.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../wcstringutil.h"
#include "../wgetopt.h" // IWYU pragma: keep
#include "../wutil.h" // IWYU pragma: keep
static const wcstring var_name_prefix = L"_flag_";

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_ARGPARSE_H
#define FISH_BUILTIN_ARGPARSE_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,21 +1,21 @@
// Implementation of the bg builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_bg.h"
#include "bg.h"
#include <cerrno>
#include <cstdlib>
#include <memory>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "job_group.h"
#include "parser.h"
#include "proc.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../job_group.h"
#include "../parser.h"
#include "../proc.h"
#include "../wutil.h" // IWYU pragma: keep
/// Helper function for builtin_bg().
static int send_to_bg(parser_t &parser, io_streams_t &streams, job_t *j) {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_BG_H
#define FISH_BUILTIN_BG_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,7 +1,7 @@
// Implementation of the bind builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_bind.h"
#include "bind.h"
#include <cerrno>
#include <cstddef>
@ -10,13 +10,13 @@
#include <string>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "input.h" // IWYU pragma: keep
#include "io.h" // IWYU pragma: keep
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../input.h" // IWYU pragma: keep
#include "../io.h" // IWYU pragma: keep
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
enum { BIND_INSERT, BIND_ERASE, BIND_KEY_NAMES, BIND_FUNCTION_NAMES };
struct bind_cmd_opts_t {

View file

@ -4,7 +4,7 @@
#include <cwchar>
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,18 +1,18 @@
// Implementation of the bind builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_block.h"
#include "block.h"
#include <cstddef>
#include "builtin.h"
#include "common.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../event.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
enum { UNSET, GLOBAL, LOCAL };
struct block_cmd_opts_t {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_BLOCK_H
#define FISH_BUILTIN_BLOCK_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -7,12 +7,12 @@
#include <cstddef>
#include <string>
#include "builtin_builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct builtin_cmd_opts_t {
bool print_help = false;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_BUILTIN_H
#define FISH_BUILTIN_BUILTIN_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,22 +1,22 @@
// Implementation of the cd builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_cd.h"
#include "cd.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <cerrno>
#include "builtin.h"
#include "common.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "path.h"
#include "proc.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../path.h"
#include "../proc.h"
#include "../wutil.h" // IWYU pragma: keep
/// The cd builtin. Changes the current directory to the one specified or to $HOME if none is
/// specified. The directory can be relative to any directory in the CDPATH variable.

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_CD_H
#define FISH_BUILTIN_CD_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,20 +1,20 @@
// Implementation of the command builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_command.h"
#include "command.h"
#include <unistd.h>
#include <string>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "path.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../path.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct command_cmd_opts_t {
bool print_help = false;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_COMMAND_H
#define FISH_BUILTIN_COMMAND_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,23 +1,24 @@
// Functions used for implementing the commandline builtin.
#include "config.h" // IWYU pragma: keep
#include "commandline.h"
#include <cerrno>
#include <cstddef>
#include <cstdlib>
#include <cwchar>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "input.h"
#include "io.h"
#include "parse_util.h"
#include "parser.h"
#include "proc.h"
#include "reader.h"
#include "tokenizer.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../input.h"
#include "../parse_util.h"
#include "../parser.h"
#include "../proc.h"
#include "../reader.h"
#include "../tokenizer.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
class parser_t;

View file

@ -5,8 +5,8 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
#include "../io.h"
#include "../maybe.h"
class parser_t;

View file

@ -1,27 +1,28 @@
// Functions used for implementing the complete builtin.
#include "config.h" // IWYU pragma: keep
#include "complete.h"
#include <cstddef>
#include <cwchar>
#include <memory>
#include <string>
#include <vector>
#include "builtin.h"
#include "color.h"
#include "common.h"
#include "complete.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep
#include "highlight.h"
#include "io.h"
#include "parse_constants.h"
#include "parse_util.h"
#include "parser.h"
#include "reader.h"
#include "wcstringutil.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../color.h"
#include "../common.h"
#include "../complete.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../highlight.h"
#include "../parse_constants.h"
#include "../parse_util.h"
#include "../parser.h"
#include "../reader.h"
#include "../wcstringutil.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
// builtin_complete_* are a set of rather silly looping functions that make sure that all the proper
// combinations of complete_add or complete_remove get called. This is needed since complete allows

View file

@ -5,8 +5,8 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
#include "../io.h"
#include "../maybe.h"
class parser_t;

View file

@ -1,18 +1,18 @@
// Implementation of the contains builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_contains.h"
#include "contains.h"
#include <unistd.h>
#include <cwchar>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct contains_cmd_opts_t {
bool print_help = false;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_CONTAINS_H
#define FISH_BUILTIN_CONTAINS_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,19 +1,19 @@
// Implementation of the disown builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_disown.h"
#include "disown.h"
#include <cerrno>
#include <csignal>
#include <set>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../wutil.h" // IWYU pragma: keep
/// Helper for builtin_disown.
static void disown_job(const wchar_t *cmd, io_streams_t &streams, job_t *j) {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_DISOWN_H
#define FISH_BUILTIN_DISOWN_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,17 +1,17 @@
// Implementation of the echo builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_echo.h"
#include "echo.h"
#include <climits>
#include <cstddef>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct echo_cmd_opts_t {
bool print_newline = true;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_ECHO_H
#define FISH_BUILTIN_ECHO_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,14 +1,14 @@
// Implementation of the emit builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_emit.h"
#include "emit.h"
#include "builtin.h"
#include "common.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../event.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../wutil.h" // IWYU pragma: keep
/// Implementation of the builtin emit command, used to create events.
maybe_t<int> builtin_emit(parser_t &parser, io_streams_t &streams, const wchar_t **argv) {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_EMIT_H
#define FISH_BUILTIN_EMIT_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -4,15 +4,15 @@
#include <cerrno>
#include <cstddef>
#include "builtin.h"
#include "common.h"
#include "exec.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../exec.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
/// Implementation of eval builtin.
maybe_t<int> builtin_eval(parser_t &parser, io_streams_t &streams, const wchar_t **argv) {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_EVAL_H
#define FISH_BUILTIN_EVAL_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,20 +1,20 @@
// Implementation of the exit builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_exit.h"
#include "exit.h"
#include <cerrno>
#include <cstddef>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "reader.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../reader.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct exit_cmd_opts_t {
bool print_help = false;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_EXIT_H
#define FISH_BUILTIN_EXIT_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,24 +1,24 @@
// Implementation of the fg builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_fg.h"
#include "fg.h"
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cwchar>
#include "builtin.h"
#include "common.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "job_group.h"
#include "parser.h"
#include "proc.h"
#include "reader.h"
#include "tokenizer.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../job_group.h"
#include "../parser.h"
#include "../proc.h"
#include "../reader.h"
#include "../tokenizer.h"
#include "../wutil.h" // IWYU pragma: keep
/// Builtin for putting a job in the foreground.
maybe_t<int> builtin_fg(parser_t &parser, io_streams_t &streams, const wchar_t **argv) {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_FG_H
#define FISH_BUILTIN_FG_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,7 +1,7 @@
// Implementation of the function builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_function.h"
#include "function.h"
#include <unistd.h>
@ -12,19 +12,19 @@
#include <string>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "complete.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep
#include "function.h"
#include "io.h"
#include "parser.h"
#include "parser_keywords.h"
#include "proc.h"
#include "signal.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../complete.h"
#include "../event.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../function.h"
#include "../io.h"
#include "../parser.h"
#include "../parser_keywords.h"
#include "../proc.h"
#include "../signal.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
namespace {
struct function_cmd_opts_t {

View file

@ -2,8 +2,8 @@
#ifndef FISH_BUILTIN_FUNCTION_H
#define FISH_BUILTIN_FUNCTION_H
#include "common.h"
#include "parse_tree.h"
#include "../common.h"
#include "../parse_tree.h"
class parser_t;
struct io_streams_t;

View file

@ -1,7 +1,7 @@
// Implementation of the functions builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_functions.h"
#include "functions.h"
#include <unistd.h>
@ -14,23 +14,23 @@
#include <utility>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "complete.h"
#include "env.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep
#include "function.h"
#include "highlight.h"
#include "io.h"
#include "parser.h"
#include "parser_keywords.h"
#include "proc.h"
#include "signal.h"
#include "termsize.h"
#include "wcstringutil.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../complete.h"
#include "../env.h"
#include "../event.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../function.h"
#include "../highlight.h"
#include "../io.h"
#include "../parser.h"
#include "../parser_keywords.h"
#include "../proc.h"
#include "../signal.h"
#include "../termsize.h"
#include "../wcstringutil.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct functions_cmd_opts_t {
bool print_help = false;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_FUNCTIONS_H
#define FISH_BUILTIN_FUNCTIONS_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,7 +1,7 @@
// Implementation of the history builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_history.h"
#include "history.h"
#include <cerrno>
#include <cstddef>
@ -10,16 +10,16 @@
#include <string>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "enum_map.h"
#include "fallback.h" // IWYU pragma: keep
#include "history.h"
#include "io.h"
#include "parser.h"
#include "reader.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../enum_map.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../history.h"
#include "../io.h"
#include "../parser.h"
#include "../reader.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
enum hist_cmd_t {
HIST_SEARCH = 1,

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_HISTORY_H
#define FISH_BUILTIN_HISTORY_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -6,14 +6,14 @@
#include <cerrno>
#include <cstddef>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
class parser_t;

View file

@ -5,8 +5,8 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
#include "../io.h"
#include "../maybe.h"
class parser_t;

View file

@ -1,7 +1,7 @@
// Implementation of the math builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_math.h"
#include "math.h"
#include <algorithm>
#include <cerrno>
@ -11,13 +11,13 @@
#include <limits>
#include <string>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "tinyexpr.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../tinyexpr.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
// The maximum number of points after the decimal that we'll print.
static constexpr int kDefaultScale = 6;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_MATH_H
#define FISH_BUILTIN_MATH_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -50,6 +50,8 @@
// This file has been imported from source code of printf command in GNU Coreutils version 6.9.
#include "config.h" // IWYU pragma: keep
#include "printf.h"
#include <sys/types.h>
#include <cerrno>
@ -63,11 +65,10 @@
#include <cwchar>
#include <cwctype>
#include "builtin.h"
#include "common.h"
#include "io.h"
#include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../wcstringutil.h"
#include "../wutil.h" // IWYU pragma: keep
class parser_t;

View file

@ -5,8 +5,8 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
#include "../maybe.h"
#include "../io.h"
class parser_t;

View file

@ -1,17 +1,17 @@
// Implementation of the pwd builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_pwd.h"
#include "pwd.h"
#include <cstring>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
/// The pwd builtin. Respect -P to resolve symbolic links. Respect -L to not do that (the default).
static const wchar_t *const short_options = L"LPh";

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_PWD_H
#define FISH_BUILTIN_PWD_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,7 +1,7 @@
// Implementation of the random builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_random.h"
#include "random.h"
#include <algorithm>
#include <cerrno>
@ -9,11 +9,11 @@
#include <cwchar>
#include <random>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../wutil.h" // IWYU pragma: keep
/// \return a random-seeded engine.
static std::minstd_rand get_seeded_engine() {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_RANDOM_H
#define FISH_BUILTIN_RANDOM_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,7 +1,7 @@
// Implementation of the read builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_read.h"
#include "read.h"
#include <termios.h>
#include <unistd.h>
@ -19,21 +19,21 @@
#include <string>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "complete.h"
#include "env.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep
#include "highlight.h"
#include "history.h"
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "reader.h"
#include "wcstringutil.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../complete.h"
#include "../env.h"
#include "../event.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../highlight.h"
#include "../history.h"
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../reader.h"
#include "../wcstringutil.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
namespace {
struct read_cmd_opts_t {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_READ_H
#define FISH_BUILTIN_READ_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,20 +1,20 @@
// Implementation of the realpath builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_realpath.h"
#include "realpath.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cwchar>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "wcstringutil.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../wcstringutil.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct realpath_cmd_opts_t {
bool print_help = false;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_REALPATH_H
#define FISH_BUILTIN_REALPATH_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,19 +1,19 @@
// Implementation of the return builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_return.h"
#include "return.h"
#include <cerrno>
#include <cstddef>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct return_cmd_opts_t {
bool print_help = false;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_RETURN_H
#define FISH_BUILTIN_RETURN_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,7 +1,7 @@
// Functions used for implementing the set builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_set.h"
#include "set.h"
#include <sys/stat.h>
#include <unistd.h>
@ -18,18 +18,18 @@
#include <string>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "env.h"
#include "expand.h"
#include "fallback.h" // IWYU pragma: keep
#include "history.h"
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "wcstringutil.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../env.h"
#include "../expand.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../history.h"
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../wcstringutil.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct set_cmd_opts_t {
bool print_help = false;

View file

@ -4,7 +4,7 @@
#include <cwchar>
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,6 +1,8 @@
// Functions used for implementing the set_color builtin.
#include "config.h"
#include "set_color.h"
#include <cstddef>
#include <cstdlib>
@ -21,15 +23,14 @@
#include <string>
#include <vector>
#include "builtin.h"
#include "color.h"
#include "common.h"
#include "env.h"
#include "io.h"
#include "output.h"
#include "parser.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../color.h"
#include "../common.h"
#include "../env.h"
#include "../output.h"
#include "../parser.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
class parser_t;

View file

@ -5,8 +5,8 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
#include "../io.h"
#include "../maybe.h"
class parser_t;

View file

@ -1,7 +1,7 @@
// Implementation of the source builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_source.h"
#include "source.h"
#include <fcntl.h>
#include <sys/stat.h>
@ -9,16 +9,16 @@
#include <cwchar>
#include "builtin.h"
#include "common.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep
#include "intern.h"
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "reader.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../intern.h"
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../reader.h"
#include "../wutil.h" // IWYU pragma: keep
/// The source builtin, sometimes called `.`. Evaluates the contents of a file in the current
/// context.

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_SOURCE_H
#define FISH_BUILTIN_SOURCE_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,22 +1,22 @@
// Implementation of the status builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_status.h"
#include "status.h"
#include <cstddef>
#include <cwchar>
#include <string>
#include "builtin.h"
#include "common.h"
#include "enum_map.h"
#include "fallback.h" // IWYU pragma: keep
#include "future_feature_flags.h"
#include "io.h"
#include "parser.h"
#include "proc.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../enum_map.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../future_feature_flags.h"
#include "../io.h"
#include "../parser.h"
#include "../proc.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
enum status_cmd_t {
STATUS_CURRENT_CMD = 1,

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_STATUS_H
#define FISH_BUILTIN_STATUS_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -22,20 +22,19 @@
#include <utility>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep
#include "future_feature_flags.h"
#include "io.h"
#include "parse_util.h"
#include "parser.h"
#include "pcre2.h"
#include "screen.h"
#include "wcstringutil.h"
#include "wgetopt.h"
#include "wildcard.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../future_feature_flags.h"
#include "../parse_util.h"
#include "../parser.h"
#include "../screen.h"
#include "../wcstringutil.h"
#include "../wgetopt.h"
#include "../wildcard.h"
#include "../wutil.h" // IWYU pragma: keep
// How many bytes we read() at once.
// Bash uses 128 here, so we do too (see READ_CHUNK_SIZE).

View file

@ -5,8 +5,8 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
#include "../io.h"
#include "../maybe.h"
class parser_t;

View file

@ -3,7 +3,7 @@
// Implemented from scratch (yes, really) by way of IEEE 1003.1 as reference.
#include "config.h" // IWYU pragma: keep
#include "builtin.h"
#include "test.h"
#include <sys/stat.h>
#include <sys/types.h>
@ -20,10 +20,11 @@
#include <type_traits>
#include <utility>
#include "common.h"
#include "io.h"
#include "parser.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../io.h"
#include "../parser.h"
#include "../wutil.h" // IWYU pragma: keep
using std::move;
using std::unique_ptr;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_TEST_H
#define FISH_BUILTIN_TEST_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,25 +1,25 @@
// Implementation of the type builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_type.h"
#include "type.h"
#include <unistd.h>
#include <string>
#include "builtin.h"
#include "common.h"
#include "complete.h"
#include "fallback.h" // IWYU pragma: keep
#include "function.h"
#include "highlight.h"
#include "io.h"
#include "parser.h"
#include "path.h"
#include "signal.h"
#include "wcstringutil.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../complete.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../function.h"
#include "../highlight.h"
#include "../io.h"
#include "../parser.h"
#include "../path.h"
#include "../signal.h"
#include "../wcstringutil.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
struct type_cmd_opts_t {
bool all = false;

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_TYPE_H
#define FISH_BUILTIN_TYPE_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -1,17 +1,19 @@
// Functions used for implementing the ulimit builtin.
#include "config.h" // IWYU pragma: keep
#include "ulimit.h"
#include <sys/resource.h>
#include <cerrno>
#include <cstddef>
#include "builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep
#include "../builtin.h"
#include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep
class parser_t;

View file

@ -5,7 +5,7 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "../io.h"
class parser_t;

View file

@ -1,19 +1,21 @@
// Functions for waiting for processes completed.
#include "builtin_wait.h"
/// Functions for waiting for processes completed.
#include "config.h" // IWYU pragma: keep
#include "wait.h"
#include <sys/wait.h>
#include <algorithm>
#include <vector>
#include "builtin.h"
#include "common.h"
#include "parser.h"
#include "proc.h"
#include "signal.h"
#include "wait_handle.h"
#include "wgetopt.h"
#include "wutil.h"
#include "../builtin.h"
#include "../common.h"
#include "../parser.h"
#include "../proc.h"
#include "../signal.h"
#include "../wait_handle.h"
#include "../wgetopt.h"
#include "../wutil.h"
/// \return true if we can wait on a job.
static bool can_wait_on_job(const std::shared_ptr<job_t> &j) {

View file

@ -2,7 +2,7 @@
#ifndef FISH_BUILTIN_WAIT_H
#define FISH_BUILTIN_WAIT_H
#include "maybe.h"
#include "../maybe.h"
class parser_t;
struct io_streams_t;

View file

@ -18,7 +18,7 @@
#include <utility>
#include <vector>
#include "builtin_bind.h"
#include "builtins/bind.h"
#include "common.h"
#include "env_dispatch.h"
#include "env_universal_common.h"

View file

@ -6748,7 +6748,7 @@ static const test_t s_tests[]{
{TEST_GROUP("ifind"), test_ifind},
{TEST_GROUP("ifind_fuzzy"), test_ifind_fuzzy},
{TEST_GROUP("abbreviations"), test_abbreviations},
{TEST_GROUP("builtin_test"), test_test},
{TEST_GROUP("builtins/test"), test_test},
{TEST_GROUP("wcstod"), test_wcstod},
{TEST_GROUP("dup2s"), test_dup2s},
{TEST_GROUP("dup2s"), test_dup2s_fd_for_target_fd},

View file

@ -20,7 +20,7 @@
#include "ast.h"
#include "builtin.h"
#include "builtin_function.h"
#include "builtins/function.h"
#include "common.h"
#include "complete.h"
#include "env.h"