From c75ab4811e61cefaaebcc1f5f776a075b7e7370f Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 18 Aug 2023 00:26:44 +0200 Subject: [PATCH] fix: show help on empty cli args --- cli/main.ts | 3 +++ cli/sync.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/cli/main.ts b/cli/main.ts index e4678094ec..5b3445f903 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -101,6 +101,9 @@ if (Number.parseInt(VERSION.replace("v", "").replace(".", "")) > 1700) { export let showDiffs = false; try { + if (Deno.args.length === 0) { + command.showHelp(); + } const LOG_LEVEL = Deno.args.includes("--verbose") || Deno.args.includes("--debug") ? "DEBUG" diff --git a/cli/sync.ts b/cli/sync.ts index a1340677d9..3b1fc5619e 100644 --- a/cli/sync.ts +++ b/cli/sync.ts @@ -829,6 +829,10 @@ async function push( } const command = new Command() + .description( + "sync local with a remote workspaces or the opposite (push or pull)" + ) + .action(() => log.info("2 actions available, pull and push. Use -h to display help.") )