diff options
| author | Alejandro Sior <aho@sior.be> | 2022-06-21 17:31:07 +0200 |
|---|---|---|
| committer | Alejandro Sior <aho@sior.be> | 2022-06-21 17:31:07 +0200 |
| commit | 68b9c04241ef433f346279fbc153928bcbd360e9 (patch) | |
| tree | 7235a65503151837906962cdc8f46ab241b432c2 /cmd/info/info.ha | |
| parent | f42a480cbe487fc5fb9b3772990e80926201f6e4 (diff) | |
gptman: polish create and convert
Diffstat (limited to 'cmd/info/info.ha')
| -rw-r--r-- | cmd/info/info.ha | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/info/info.ha b/cmd/info/info.ha index 75ab499..8c0110a 100644 --- a/cmd/info/info.ha +++ b/cmd/info/info.ha @@ -1,19 +1,20 @@ use fmt; use io; +use os; use gpt; use cmd; fn booltonum(a: bool) str = if (a) { return "1"; } else { return "0"; }; -export fn info(vol: str, args: []str) void = { - const name = vol; - const vol = cmd::opengpt(vol); +export fn info(args: []str) void = { + const fd = cmd::openfile(); + const vol = cmd::opengpt(fd); defer gpt::finish(vol); const header = vol.primary.header; - fmt::printfln("# GPT header info {}", name)!; + fmt::printfln("# GPT header info {}", os::args[1])!; fmt::printfln("revision({})", header.revision)!; fmt::printfln("header_size({})", header.header_size)!; fmt::printfln("header_crc32({})", header.header_crc32)!; |
