Add named local build variants
This commit is contained in:
@@ -82,6 +82,10 @@ pub fn main(init: std.process.Init) !u8 {
|
||||
return 69;
|
||||
}
|
||||
if (std.mem.eql(u8, arg, "mimctl")) {
|
||||
if (!profile.local_socket) {
|
||||
try printProfileStub(init.io, stderr, "mimctl");
|
||||
return 69;
|
||||
}
|
||||
const sub = args.next() orelse {
|
||||
try stderr.writeStreamingAll(init.io, "mim: mimctl requires a subcommand\n");
|
||||
return 64;
|
||||
@@ -101,6 +105,10 @@ pub fn main(init: std.process.Init) !u8 {
|
||||
}
|
||||
|
||||
if (std.mem.eql(u8, arg, "--mimctl")) {
|
||||
if (!profile.local_socket) {
|
||||
try printProfileStub(init.io, stderr, "mimctl");
|
||||
return 69;
|
||||
}
|
||||
const socket_path = args.next() orelse {
|
||||
try stderr.writeStreamingAll(init.io, "mim: --mimctl requires a socket path\n");
|
||||
return 64;
|
||||
@@ -152,6 +160,7 @@ fn printProfile(allocator: std.mem.Allocator, io: std.Io, stdout: std.Io.File) !
|
||||
|
||||
fn isProfileStub(arg: []const u8) bool {
|
||||
return std.mem.eql(u8, arg, "remote") or
|
||||
std.mem.eql(u8, arg, "mimctl") or
|
||||
std.mem.eql(u8, arg, "plugin") or
|
||||
std.mem.eql(u8, arg, "plugins") or
|
||||
std.mem.eql(u8, arg, "background-agent") or
|
||||
@@ -243,6 +252,7 @@ test "regular: help text names the binary and smoke boundary" {
|
||||
|
||||
test "regular: excluded profile capabilities have explicit stubs" {
|
||||
try std.testing.expect(isProfileStub("remote"));
|
||||
try std.testing.expect(isProfileStub("mimctl"));
|
||||
try std.testing.expect(isProfileStub("plugin"));
|
||||
try std.testing.expect(isProfileStub("background-agent"));
|
||||
try std.testing.expect(!isProfileStub("context"));
|
||||
|
||||
Reference in New Issue
Block a user