Skip to content

Commit 4b9522d

Browse files
committed
Merge branch 'master' into feature/release_examples
2 parents 14ea70e + f3406e1 commit 4b9522d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ void print_help() {
1010
printf("Nature Programming Language Compiler %s\n\n", BUILD_VERSION);
1111
printf("Usage:\n");
1212
printf(" nature [command] [flags] [arguments]\n\n");
13-
13+
1414
printf("Available Commands:\n");
1515
printf(" build Build a Nature source file\n\n");
16-
16+
1717
printf("Build Command Usage:\n");
1818
printf(" nature build [flags] <source_file>\n\n");
19-
19+
2020
printf("Build Flags:\n");
2121
printf(" -o <name> Specify output filename (default: main)\n");
2222
printf(" --archive Generate static library (output: lib<name>.a)\n");
@@ -26,13 +26,13 @@ void print_help() {
2626

2727
printf("Cross Compilation:\n");
2828
printf(" nature build --target <platform> <source_file>\n\n");
29-
29+
3030
printf(" Supported Platforms:\n");
3131
printf(" - linux_amd64 Linux on x86-64 architecture\n");
3232
printf(" - linux_arm64 Linux on ARM 64-bit architecture\n");
3333
printf(" - darwin_amd64 macOS on x86-64 architecture\n");
3434
printf(" - darwin_arm64 macOS on ARM 64-bit architecture (Apple Silicon)\n\n");
35-
35+
3636
printf("Examples:\n");
3737
printf(" nature build main.n # Basic build\n");
3838
printf(" nature build -o test main.n # Custom output name\n");
@@ -42,7 +42,7 @@ void print_help() {
4242

4343
printf("Global Flags:\n");
4444
printf(" --help, -h Show help information\n");
45-
printf(" --version Show version information\n");
45+
printf(" --version, -v Show version information\n");
4646
}
4747

4848
/**
@@ -63,8 +63,8 @@ int main(int argc, char *argv[]) {
6363
print_help();
6464
return 0;
6565
}
66-
67-
if (str_equal(first, "--version")) {
66+
67+
if (str_equal(first, "--version") || str_equal(first, "-v")) {
6868
printf("nature %s - %s build %s\n", BUILD_VERSION, BUILD_TYPE, BUILD_TIME);
6969
return 0;
7070
}

src/build/build.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,10 @@ static void build_archive(slice_t *modules) {
955955
strcat(cmd, " ");
956956
strcat(cmd, custom_link_object_path());
957957

958-
system(cmd);
958+
int result = system(cmd);
959+
if (result != 0) {
960+
assertf(false, "Compiling static library failed. ar command error: %d", result);
961+
}
959962

960963
strcpy(BUILD_OUTPUT, path_join(BUILD_OUTPUT_DIR, "libmain.a"));
961964

0 commit comments

Comments
 (0)