From 01ea4c9f15136e69c8729b527a68b1a07fbe449e Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 1 Nov 2022 15:00:37 +0100 Subject: [PATCH] Fix plug:compile flags --- cmd/{plug_bundle.ts => plug_compile.ts} | 3 ++- silverbullet.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) rename cmd/{plug_bundle.ts => plug_compile.ts} (86%) diff --git a/cmd/plug_bundle.ts b/cmd/plug_compile.ts similarity index 86% rename from cmd/plug_bundle.ts rename to cmd/plug_compile.ts index 07d7fd6c..724129fd 100644 --- a/cmd/plug_bundle.ts +++ b/cmd/plug_compile.ts @@ -1,7 +1,7 @@ import { bundleRun } from "../plugos/bin/plugos-bundle.ts"; import { esbuild } from "../plugos/compile.ts"; -export async function plugBundleCommand( +export async function plugCompileCommand( { watch, dist, debug, info, importmap }: { watch: boolean; dist: string; @@ -11,6 +11,7 @@ export async function plugBundleCommand( }, ...manifestPaths: string[] ) { + console.log("All optiosn", arguments); await bundleRun( manifestPaths, dist, diff --git a/silverbullet.ts b/silverbullet.ts index 24f50885..4f3eeef1 100755 --- a/silverbullet.ts +++ b/silverbullet.ts @@ -6,7 +6,7 @@ import { upgradeCommand } from "./cmd/upgrade.ts"; import { versionCommand } from "./cmd/version.ts"; import { fixCommand } from "./cmd/fix.ts"; import { serveCommand } from "./cmd/server.ts"; -import { plugBundleCommand } from "./cmd/plug_bundle.ts"; +import { plugCompileCommand } from "./cmd/plug_compile.ts"; await new Command() .name("silverbullet") @@ -25,11 +25,13 @@ await new Command() .command("fix", "Fix a broken space") .arguments("") .action(fixCommand) - // plug:bundle + // plug:compile .command("plug:compile", "Bundle (compile) one or more plug manifests") .arguments("<...name.plug.yaml:string>") - .option("--debug", "Do not minifiy code", { default: false }) - .option("--info", "Print out size info per function", { default: false }) + .option("--debug [type:boolean]", "Do not minifiy code", { default: false }) + .option("--info [type:boolean]", "Print out size info per function", { + default: false, + }) .option("--watch, -w [type:boolean]", "Watch for changes and rebuild", { default: false, }) @@ -39,7 +41,7 @@ await new Command() { default: "." }, ) .option("--importmap ", "Path to import map file to use") - .action(plugBundleCommand) + .action(plugCompileCommand) // upgrade .command("upgrade", "Upgrade Silver Bullet") .action(upgradeCommand)