~emersion/mrsh

14e90a9f1d63ef94781213741aa4d71b2b11593f — emersion 2 years ago 5e0da68
Rename source builtin to dot

For consistency with POSIX
4 files changed, 6 insertions(+), 6 deletions(-)

M builtin/builtin.c
R builtin/{source.c => dot.c}
M include/builtin.h
M meson.build
M builtin/builtin.c => builtin/builtin.c +1 -1
@@ 14,7 14,7 @@ struct builtin {

static const struct builtin builtins[] = {
	// Keep alpha sorted
	{ ".", builtin_source, true },
	{ ".", builtin_dot, true },
	{ ":", builtin_colon, true },
	{ "alias", builtin_alias, false },
	{ "cd", builtin_cd, false },

R builtin/source.c => builtin/dot.c +1 -1
@@ 13,7 13,7 @@

static const char source_usage[] = "usage: . <path>\n";

int builtin_source(struct mrsh_state *state, int argc, char *argv[]) {
int builtin_dot(struct mrsh_state *state, int argc, char *argv[]) {
	if (argc != 2) {
		fprintf(stderr, source_usage);
		return EXIT_FAILURE;

M include/builtin.h => include/builtin.h +3 -3
@@ 11,17 11,17 @@ void print_escaped(const char *value);
int builtin_alias(struct mrsh_state *state, int argc, char *argv[]);
int builtin_cd(struct mrsh_state *state, int argc, char *argv[]);
int builtin_colon(struct mrsh_state *state, int argc, char *argv[]);
int builtin_dot(struct mrsh_state *state, int argc, char *argv[]);
int builtin_eval(struct mrsh_state *state, int argc, char *argv[]);
int builtin_exit(struct mrsh_state *state, int argc, char *argv[]);
int builtin_export(struct mrsh_state *state, int argc, char *argv[]);
int builtin_eval(struct mrsh_state *state, int argc, char *argv[]);
int builtin_false(struct mrsh_state *state, int argc, char *argv[]);
int builtin_getopts(struct mrsh_state *state, int argc, char *argv[]);
int builtin_pwd(struct mrsh_state *state, int argc, char *argv[]);
int builtin_read(struct mrsh_state *state, int argc, char *argv[]);
int builtin_set(struct mrsh_state *state, int argc, char *argv[]);
int builtin_shift(struct mrsh_state *state, int argc, char *argv[]);
int builtin_source(struct mrsh_state *state, int argc, char *argv[]);
int builtin_times(struct mrsh_state *state, int argc, char *argv[]);
int builtin_set(struct mrsh_state *state, int argc, char *argv[]);
int builtin_true(struct mrsh_state *state, int argc, char *argv[]);
int builtin_type(struct mrsh_state *state, int argc, char *argv[]);
int builtin_unalias(struct mrsh_state *state, int argc, char *argv[]);

M meson.build => meson.build +1 -1
@@ 38,6 38,7 @@ lib_mrsh = library(
		'builtin/builtin.c',
		'builtin/cd.c',
		'builtin/colon.c',
		'builtin/dot.c',
		'builtin/eval.c',
		'builtin/exit.c',
		'builtin/export.c',


@@ 47,7 48,6 @@ lib_mrsh = library(
		'builtin/read.c',
		'builtin/set.c',
		'builtin/shift.c',
		'builtin/source.c',
		'builtin/times.c',
		'builtin/true.c',
		'builtin/type.c',