fix argv parsing on windows (#8458)

* fix argv parsing on windows

* directly use zig stdlib

* remove debug comments, fix double deinit

* change bun.argv() to return slices, not null-terminated pointers

* fix test on windows to escape file paths correctly

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
Georgijs
2024-01-24 20:54:01 -08:00
committed by GitHub
parent 0bf8a25d50
commit 80bd3254cc
12 changed files with 49 additions and 59 deletions

View File

@@ -89,10 +89,9 @@ pub const InitCommand = struct {
entry_point: string = "",
};
pub fn exec(alloc: std.mem.Allocator, argv: [][*:0]u8) !void {
pub fn exec(alloc: std.mem.Allocator, argv: [][:0]u8) !void {
const print_help = brk: {
for (argv) |arg_| {
const arg = bun.span(arg_);
for (argv) |arg| {
if (strings.eqlComptime(arg, "--help")) {
break :brk true;
}