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) {...@@ -20,9 +20,9 @@ static int usage(const char *arg0) {
20 fprintf(stderr, "Usage: %s [command] [options]\n"20 fprintf(stderr, "Usage: %s [command] [options]\n"
21 "Commands:\n"21 "Commands:\n"
22 " build build project from build.zig\n"22 " build build project from build.zig\n"
23 " build_exe [source] create executable from source or object files\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"24 " build-lib [source] create library from source or object files\n"
25 " build_obj [source] create object from source or assembly\n"25 " build-obj [source] create object from source or assembly\n"
26 " parsec [source] convert c code to zig code\n"26 " parsec [source] convert c code to zig code\n"
27 " targets list available compilation targets\n"27 " targets list available compilation targets\n"
28 " test [source] create and run a test build\n"28 " test [source] create and run a test build\n"
...@@ -457,13 +457,13 @@ int main(int argc, char **argv) {...@@ -457,13 +457,13 @@ int main(int argc, char **argv) {
457 }457 }
458 }458 }
459 } else if (cmd == CmdInvalid) {459 } else if (cmd == CmdInvalid) {
460 if (strcmp(arg, "build_exe") == 0) {460 if (strcmp(arg, "build-exe") == 0) {
461 cmd = CmdBuild;461 cmd = CmdBuild;
462 out_type = OutTypeExe;462 out_type = OutTypeExe;
463 } else if (strcmp(arg, "build_obj") == 0) {463 } else if (strcmp(arg, "build-obj") == 0) {
464 cmd = CmdBuild;464 cmd = CmdBuild;
465 out_type = OutTypeObj;465 out_type = OutTypeObj;
466 } else if (strcmp(arg, "build_lib") == 0) {466 } else if (strcmp(arg, "build-lib") == 0) {
467 cmd = CmdBuild;467 cmd = CmdBuild;
468 out_type = OutTypeLib;468 out_type = OutTypeLib;
469 } else if (strcmp(arg, "version") == 0) {469 } else if (strcmp(arg, "version") == 0) {
std/build.zig+3-3
...@@ -902,9 +902,9 @@ pub const LibExeObjStep = struct {...@@ -902,9 +902,9 @@ pub const LibExeObjStep = struct {
902 defer zig_args.deinit();902 defer zig_args.deinit();
903903
904 const cmd = switch (self.kind) {904 const cmd = switch (self.kind) {
905 Kind.Lib => "build_lib",905 Kind.Lib => "build-lib",
906 Kind.Exe => "build_exe",906 Kind.Exe => "build-exe",
907 Kind.Obj => "build_obj",907 Kind.Obj => "build-obj",
908 };908 };
909 %%zig_args.append(cmd);909 %%zig_args.append(cmd);
910910
test/tests.zig+1-1
...@@ -535,7 +535,7 @@ pub const CompileErrorContext = struct {...@@ -535,7 +535,7 @@ pub const CompileErrorContext = struct {
535 const obj_path = %%os.path.join(b.allocator, b.cache_root, "test.o");535 const obj_path = %%os.path.join(b.allocator, b.cache_root, "test.o");
536536
537 var zig_args = ArrayList([]const u8).init(b.allocator);537 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");
539 %%zig_args.append(b.pathFromRoot(root_src));539 %%zig_args.append(b.pathFromRoot(root_src));
540540
541 %%zig_args.append("--name");541 %%zig_args.append("--name");