summaryrefslogtreecommitdiff
path: root/main.ha
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sior.be>2022-06-18 14:43:46 +0200
committerAlejandro Sior <aho@sior.be>2022-06-18 14:43:46 +0200
commitfd2f5a94d6ad595e8bed354eca168a82b882e8b4 (patch)
treef30495b2ca343e1baf189e8a9f20f6234848fdea /main.ha
parent6117a803ad717fd50003c0bd8fbe393db2dcac6b (diff)
gptman: change the way of how args are passed to subcommands
Diffstat (limited to 'main.ha')
-rw-r--r--main.ha9
1 files changed, 2 insertions, 7 deletions
diff --git a/main.ha b/main.ha
index 508bd0c..53f5148 100644
--- a/main.ha
+++ b/main.ha
@@ -12,18 +12,13 @@ use create;
use header;
use mkbackup;
+
export fn main() void = {
if (len(os::args) < 3) {
fmt::fatalf("{}: expected disk name", os::args[0]);
};
- const volume = match(os::create(os::args[1], fs::mode::USER_RWX | fs::mode::GROUP_RX | fs::mode::OTHER_RX, fs::flags::RDWR)) {
- case let v: io::file =>
- yield v;
- case =>
- fmt::fatalf("{}: cannot open file {}", os::args[0], os::args[1]);
- };
- defer io::close(volume)!;
+ const volume = os::args[1];
switch (os::args[2]) {
case "convert" => convert::convert(volume, os::args[2..]);