add version control
This commit is contained in:
parent
f1917aa4fc
commit
512b1a821e
BIN
build/main.o
BIN
build/main.o
Binary file not shown.
|
|
@ -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") {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef SUN_VERSION_H
|
||||
#define SUN_VERSION_H
|
||||
|
||||
#define SUN_VERSION "0.3.0"
|
||||
|
||||
#endif // SUN_VERSION_H
|
||||
Loading…
Reference in New Issue