build support list options

master
mogud 2019-12-19 21:34:38 +08:00 committed by Andrew Kelley
parent 156e43b463
commit 688d02176c
1 changed files with 9 additions and 1 deletions

View File

@ -557,7 +557,15 @@ pub const Builder = struct {
},
UserValue.Scalar => |s| return s,
},
TypeId.List => panic("TODO list options to build script", .{}),
TypeId.List => switch (entry.value.value) {
UserValue.Flag => {
warn("Expected -D{} to be a list, but received a boolean.\n", .{name});
self.markInvalidUserInput();
return null;
},
UserValue.Scalar => |s| return &[_][]const u8{s},
UserValue.List => |lst| return lst.toSliceConst(),
},
}
}