Skip to content

Commit

Permalink
improve: remove default command
Browse files Browse the repository at this point in the history
  • Loading branch information
sdnts committed Mar 10, 2024
1 parent 527ebb5 commit 9d2f8cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
});
exe.linkLibC();

b.installArtifact(exe);

Expand Down
5 changes: 3 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ pub fn main() !void {
const stdout = std.io.getStdOut();

if (args.len == 1) {
try Install.init(a, &.{});
try Zup.help();
try stderr.writeAll("\x1B[38;5;9merror: Missing command\x1B[38;5;0m\n\n");
} else if (std.mem.eql(u8, args[1], "install")) {
try Install.init(a, args[2..]);
} else if (std.mem.eql(u8, args[1], "list")) {
Expand All @@ -34,7 +35,7 @@ pub fn main() !void {
try Zup.help();
} else {
try Zup.help();
try stderr.writeAll("\x1B[38;5;9mUnknown command: ");
try stderr.writeAll("\x1B[38;5;9merror: Unknown command: ");
try stderr.writeAll(args[1]);
try stderr.writeAll("\x1B[38;5;0m\n\n");
}
Expand Down
2 changes: 1 addition & 1 deletion src/zup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn help() !void {
\\ install (default) Download and install Zig and ZLS versions
\\ list List all downloaded Zig and ZLS versions
\\
\\General options:
\\Options:
\\ -v, --version Print version of Zup
\\ -h, --help Print command-specific usage
\\
Expand Down

0 comments on commit 9d2f8cf

Please sign in to comment.