Skip to content

Commit 65bf9ad

Browse files
committed
adds version constant
1 parent b316180 commit 65bf9ad

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

include/glms/version.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef GLMS_VERSION_H
2+
#define GLMS_VERSION_H
3+
4+
#define GLMS_VERSION_MAJOR 0
5+
#define GLMS_VERSION_MINOR 0
6+
#define GLMS_VERSION_PATCH 1
7+
8+
#define GLMS_VERSION_STRING "0.0.1"
9+
10+
#endif

src/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <glms/glms.h>
33
#include <glms/io.h>
44
#include <glms/macros.h>
5+
#include <glms/version.h>
56
#include <hashy/hashy.h>
67
#include <stdio.h>
78
#include <string.h>
@@ -56,7 +57,7 @@ static int glms_interactive() {
5657
fgets(input_source, 1024, stdin);
5758
fflush(stdin);
5859

59-
GLMSAST *result = glms_env_exec_source(&env, input_source);
60+
glms_env_exec_source(&env, input_source);
6061
glms_env_reset(&env);
6162
}
6263

@@ -78,6 +79,9 @@ int main(int argc, char *argv[]) {
7879
glms_env_clear(&env);
7980
cli_args_destroy(&cli);
8081
return 0;
82+
} else if (cli_args_has(&cli, "--version")) {
83+
printf("GLMS Version %s\n", GLMS_VERSION_STRING);
84+
return 0;
8185
}
8286

8387
char *source = glms_get_file_contents(argv[1]);

0 commit comments

Comments
 (0)