Skip to content

Commit

Permalink
fix(#4): Set ErrorContext.cmd before returning an error
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwalCH committed Sep 4, 2022
1 parent 4153a51 commit 35664a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/parser/Parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ fn parseSubCommand(
or valid_subcmd.subcommands.items.len >= 1) {
// zig fmt: on
const subcmd_argv = self.tokenizer.restArg() orelse {
self.err_ctx.setCmd(valid_subcmd);
self.err_ctx.setErr(Error.CommandArgumentNotProvided);
return self.err_ctx.err;
};
Expand Down

0 comments on commit 35664a6

Please sign in to comment.