~bmp/hayom

440ad5245d672c087530d3a610e662c0e0af8c62 — Benjamin Pollack 7 months ago c5df80e
add --help

Implements: https://todo.sr.ht/~bmp/hayom/6
1 files changed, 18 insertions(+), 0 deletions(-)

M cli.ts
M cli.ts => cli.ts +18 -0
@@ 62,6 62,19 @@ async function edit(body: string, editor: string[]) {
  }
}

function printHelp() {
  console.log(`
usage: hayom [-j journal] ...
options:
   --summary | -s: print summary line only
   --from | -f:    from timestamp
   --to | -t:      to timestamp
   --on:           on timestamp
   --count | -n:   number of entries to print
   --journal | -j: journal to use
`);
}

async function main() {
  const args = [...Deno.args];
  const config = loadConfig();


@@ 77,6 90,11 @@ async function main() {
    },
  });

  if (opts.help) {
    printHelp();
    return;
  }

  const journal = opts.journal ?? config.default;
  const path = config.journals[journal].journal;