Hejsil / zig-clap

Command line argument parsing library
MIT License
939 stars 67 forks source link

Have a plan for using into build.zig? #135

Closed ritalin closed 2 months ago

ritalin commented 2 months ago

I'd like to use this module into build.zig. Using const clap = @import("clap") into build.zig in my project led to load build.zig of zig-clap. Because a loaded file id not a module but a builder, It will fail to build.

Do you have a plan for using into build.zig?

IMO, it will resolve in build.zig following:

const std = @import("std");
+ pub usingnamespace @import("clap.zig"); // add this line
// (snip) following code
Hejsil commented 2 months ago

Sorry, but I don't understand what you're suggesting/asking 😓

aikawayataro commented 2 months ago

I guess he's asking for feature when you can access module from build.zig, like this: https://zig.news/liyu1981/how-to-use-your-fav-pkg-in-buildzig-3ni8 I can't see a valid reason for this though

Hejsil commented 2 months ago

Aah I see. Yea, I don't see a valid reason to do this either. zig build handles arguments for build.zig so using zig-clap in build.zig wouldn't be wise.

ritalin commented 2 months ago

OK, I see.