add version control

This commit is contained in:
Talles Amadeu 2025-12-09 13:46:22 -03:00
parent f1917aa4fc
commit 512b1a821e
4 changed files with 9 additions and 2 deletions

Binary file not shown.

View File

@ -6,6 +6,7 @@
#include "parser.h"
#include "ast_printer.h"
#include "codegen.h"
#include "version.h"
#include <llvm/Support/FileSystem.h>
#include <llvm/Support/raw_ostream.h>
@ -167,7 +168,7 @@ void* sun_read_csv(char* filename, char* separator, char* quote) {
)";
void printUsage() {
std::cout << "Sun Language Compiler v0.1.0" << std::endl;
std::cout << "Sun Language Compiler v" << SUN_VERSION << std::endl;
std::cout << "Usage: sun <filename> [options]" << std::endl;
std::cout << "Options:" << std::endl;
std::cout << " -o <file> Specify output executable name" << std::endl;
@ -183,7 +184,7 @@ int main(int argc, char* argv[]) {
std::string arg1 = argv[1];
if (arg1 == "-v" || arg1 == "--version") {
std::cout << "Sun Language Compiler v0.1.0" << std::endl;
std::cout << "Sun Language Compiler v" << SUN_VERSION << std::endl;
return 0;
}
if (arg1 == "-h" || arg1 == "--help") {

6
src/version.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef SUN_VERSION_H
#define SUN_VERSION_H
#define SUN_VERSION "0.3.0"
#endif // SUN_VERSION_H

BIN
sun

Binary file not shown.