Be more explicit about device management

This commit is contained in:
Emil Lerch 2025-12-09 13:48:40 -08:00
parent 82babf0ce6
commit afc81e3b95
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -413,7 +413,13 @@ pub fn main() !void {
}
try stdout.flush();
if (result.devices.len > 0) {
switch (result.devices.len) {
0 => {
try stderr.print("❌ No devices found for user\n", .{});
try stderr.flush();
return error.NoDevicesFound;
},
1 => {
const device = result.devices[0];
if (device.serial_id) |sid| {
@ -440,5 +446,11 @@ pub fn main() !void {
try stderr.flush();
return error.NoSerialId;
}
},
else => {
try stderr.print("❌ More than one device found for user, not currently equipped to handle this\n", .{});
try stderr.flush();
return error.TooManyDevicesFound;
},
}
}