mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 18:48:33 -04:00
feat(comma): Added enum value for unknown commands.
This commit is contained in:
17
src/root.zig
17
src/root.zig
@@ -11,16 +11,18 @@ pub const root: Command = .new(.{
|
||||
.{
|
||||
.name = "deps",
|
||||
.short = "Check for missing binaries",
|
||||
.long = \\envr relies on external binaries for certain functionality.
|
||||
\\
|
||||
\\ The deps command reports which binaries are available and which are not.",
|
||||
.long =
|
||||
\\envr relies on external binaries for certain functionality.
|
||||
\\
|
||||
\\ The deps command reports which binaries are available and which are not."
|
||||
,
|
||||
},
|
||||
.{ .name = "version" },
|
||||
},
|
||||
});
|
||||
|
||||
test "enum type" {
|
||||
const got: root.Type = @enumFromInt(1);
|
||||
const got: root.Type = @enumFromInt(2);
|
||||
|
||||
try std.testing.expectEqual(.version, got);
|
||||
}
|
||||
@@ -31,3 +33,10 @@ test "parse version" {
|
||||
|
||||
try std.testing.expectEqual(.version, cmd);
|
||||
}
|
||||
|
||||
test "parse unknown" {
|
||||
const args = &[_][]const u8{"bad", "value"};
|
||||
const cmd = root.parse(args);
|
||||
|
||||
try std.testing.expectEqual(.unknown, cmd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user