tlang/source/tlang/commandline/commands.d

42 lines
717 B
D
Raw Normal View History

/**
* Commands
*
* All command-line arguments and their impementations
*/
module commandline.commands;
import jcli;
import std.stdio;
2021-03-02 19:55:45 +00:00
import compiler.compiler : beginCompilation;
@Command("help", "Shows the help screen")
struct helpCommand
{
void onExecute()
{
}
}
@Command("compile", "Compiles the given file(s)")
struct compileCommand
{
@CommandPositionalArg(0, "source file", "The source file to compile")
string sourceFile;
// @CommandRawListArg
// string[] d;
// TODO: Get array
void onExecute()
{
writeln("Compiling source file: "~sourceFile);
2021-03-02 19:55:45 +00:00
/* TODO: Read file */
string sourceCode = "";
beginCompilation([sourceFile]);
}
}