mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
* Make native installs portable and smaller - Support glibc 2.34 with portable compiler binaries and static LLVM helpers. - Bundle the host runtime and discover optional cross-target packs from project dependencies. - Add application build benchmarks covering latency, executable size, and memory. * Keep bootstrap tools available in Sandbox validation - Isolate Zig for native compiler bootstrap and glibc entropy contracts. - Preserve the existing toolchain scope for cache and corpus tests. * Fix portable compiler bootstrap linking - Keep native support objects compatible with the destination host linker. - Resolve installed targets using the host declared by the toolchain manifest.
16 lines
650 B
TypeScript
16 lines
650 B
TypeScript
export interface Options { file: string; category: string; limit: number }
|
|
export function options(args: string[]): Options {
|
|
let file = "";
|
|
let category = "";
|
|
let limit = 12;
|
|
for (let i = 0; i < args.length; i++) {
|
|
const argument = args[i]!;
|
|
if (argument === "--category") category = args[++i]!;
|
|
else if (argument === "--limit") limit = Number(args[++i]);
|
|
else if (file === "") file = argument;
|
|
else throw new Error("unexpected argument: " + argument);
|
|
}
|
|
if (file === "" || !Number.isInteger(limit) || limit < 1) throw new Error("expected an inventory file and positive limit");
|
|
return { file, category, limit };
|
|
}
|