summaryrefslogtreecommitdiffstats
path: root/cmd-source-file.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-05-23 13:02:27 +0100
committerThomas Adam <thomas@xteddy.org>2019-05-23 13:02:27 +0100
commit75aeb733f292639f8332df11315ca8280e5631fd (patch)
treed459b4c2381ca737009613577deafe14196eceef /cmd-source-file.c
parent7ca2e2fe88cd282d3e8faea3f2000ad15972f71d (diff)
parent723010ba72e337832402f8e44981c02caa30b476 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-source-file.c')
-rw-r--r--cmd-source-file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd-source-file.c b/cmd-source-file.c
index 5a3be6f9..a38ecb57 100644
--- a/cmd-source-file.c
+++ b/cmd-source-file.c
@@ -37,8 +37,8 @@ const struct cmd_entry cmd_source_file_entry = {
.name = "source-file",
.alias = "source",
- .args = { "q", 1, 1 },
- .usage = "[-q] path",
+ .args = { "nq", 1, 1 },
+ .usage = "[-nq] path",
.flags = 0,
.exec = cmd_source_file_exec
@@ -58,7 +58,9 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
u_int i;
if (args_has(args, 'q'))
- flags |= CFG_QUIET;
+ flags |= CMD_PARSE_QUIET;
+ if (args_has(args, 'n'))
+ flags |= CMD_PARSE_PARSEONLY;
if (*path == '/')
pattern = xstrdup(path);
@@ -71,7 +73,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
retval = CMD_RETURN_NORMAL;
if (glob(pattern, 0, NULL, &g) != 0) {
- if (errno != ENOENT || (~flags & CFG_QUIET)) {
+ if (errno != ENOENT || (~flags & CMD_PARSE_QUIET)) {
cmdq_error(item, "%s: %s", path, strerror(errno));
retval = CMD_RETURN_ERROR;
}