Add encode subcommand

Wraps gid.encodeGid, prints the packed-u32 as decimal on stdout,
emits usage on stderr on bad arity, and a labelled error on
out-of-range or non-integer input.
This commit is contained in:
Axel Meyer
2026-05-23 13:46:03 +02:00
parent b1743ad19f
commit 7316ebc7dd
3 changed files with 87 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ function run(argv, { out, err }) {
return 0;
}
const handlers = {
// populated in subsequent tasks
encode: require('./commands/encode'),
};
const handler = handlers[head];
if (!handler) {