authorgravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2017-09-16 17:00:59+12:00
committergravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2017-09-17 12:26:13+12:00
log71342f824991a8b183f895577e81d27dd6494bee
tree7f4fa444d13fb7efdb6e8568f2cc7c8af050e10d
parentdcc5f245693fca972890107ae08ce30cc7463bdb

Add dash arguments for cli


3 files changed, 10 insertions(+), 10 deletions(-)

src/main.cpp+6-6
......@@ -20,9 +20,9 @@ static int usage(const char *arg0) {
2020 fprintf(stderr, "Usage: %s [command] [options]\n"
2121 "Commands:\n"
2222 " build build project from build.zig\n"
23 " build_exe [source] create executable from source or object files\n"
24 " build_lib [source] create library from source or object files\n"
25 " build_obj [source] create object from source or assembly\n"
23 " build-exe [source] create executable from source or object files\n"
24 " build-lib [source] create library from source or object files\n"
25 " build-obj [source] create object from source or assembly\n"
2626 " parsec [source] convert c code to zig code\n"
2727 " targets list available compilation targets\n"
2828 " test [source] create and run a test build\n"
......@@ -457,13 +457,13 @@ int main(int argc, char **argv) {
457457 }
458458 }
459459 } else if (cmd == CmdInvalid) {
460 if (strcmp(arg, "build_exe") == 0) {
460 if (strcmp(arg, "build-exe") == 0) {
461461 cmd = CmdBuild;
462462 out_type = OutTypeExe;
463 } else if (strcmp(arg, "build_obj") == 0) {
463 } else if (strcmp(arg, "build-obj") == 0) {
464464 cmd = CmdBuild;
465465 out_type = OutTypeObj;
466 } else if (strcmp(arg, "build_lib") == 0) {
466 } else if (strcmp(arg, "build-lib") == 0) {
467467 cmd = CmdBuild;
468468 out_type = OutTypeLib;
469469 } else if (strcmp(arg, "version") == 0) {
std/build.zig+3-3
......@@ -902,9 +902,9 @@ pub const LibExeObjStep = struct {
902902 defer zig_args.deinit();
903903
904904 const cmd = switch (self.kind) {
905 Kind.Lib => "build_lib",
906 Kind.Exe => "build_exe",
907 Kind.Obj => "build_obj",
905 Kind.Lib => "build-lib",
906 Kind.Exe => "build-exe",
907 Kind.Obj => "build-obj",
908908 };
909909 %%zig_args.append(cmd);
910910
test/tests.zig+1-1
......@@ -535,7 +535,7 @@ pub const CompileErrorContext = struct {
535535 const obj_path = %%os.path.join(b.allocator, b.cache_root, "test.o");
536536
537537 var zig_args = ArrayList([]const u8).init(b.allocator);
538 %%zig_args.append(if (self.case.is_exe) "build_exe" else "build_obj");
538 %%zig_args.append(if (self.case.is_exe) "build-exe" else "build-obj");
539539 %%zig_args.append(b.pathFromRoot(root_src));
540540
541541 %%zig_args.append("--name");