2021-03-02 19:51:49 +00:00
|
|
|
/**
|
|
|
|
* 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;
|
2021-03-02 19:51:49 +00:00
|
|
|
|
|
|
|
@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]);
|
2021-03-02 19:51:49 +00:00
|
|
|
}
|
|
|
|
}
|