commit be763d37941a511b700ed9e4fef467a1f803c111
parent 0c6c1db22c64c92bd8a254582063c173c8e66196
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 12 Mar 2021 13:55:39 -0500
deps: new subcommand (placeholder)
Diffstat:
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/main.ha b/main.ha
@@ -4,7 +4,7 @@ use os;
export fn main() void = {
let help: []getopt::help = [
"compile, run, and test Hare programs",
- "<build | run | test | version>", "args...",
+ "<build | deps | run | test | version>", "args...",
];
let cmd = getopt::parse(os::args, help...);
defer getopt::finish(&cmd);
@@ -13,6 +13,7 @@ export fn main() void = {
os::exit(1);
};
if (cmd.args[0] == "build") build(cmd.args)
+ else if (cmd.args[0] == "deps") deps(cmd.args)
else if (cmd.args[0] == "run") run(cmd.args)
else if (cmd.args[0] == "test") test(cmd.args)
else if (cmd.args[0] == "version") version(cmd.args)
diff --git a/subcmds.ha b/subcmds.ha
@@ -98,6 +98,21 @@ fn build(args: []str) void = {
plan_execute(&plan, verbose);
};
+fn deps(args: []str) void = {
+ let help: []getopt::help = [
+ "prints dependency information for Hare programs",
+ ('M', "print rules for POSIX make"),
+ ('m', "print module names only"),
+ ('T', "tags...", "set build tags"),
+ ('X', "tags...", "unset build tags"),
+ "path",
+ ];
+ let cmd = getopt::parse(args, help...);
+ defer getopt::finish(&cmd);
+
+ abort(); // TODO
+};
+
fn run(args: []str) void = {
let help: []getopt::help = [
"compiles and runs Hare programs",