From 26549ea92723843a8522705dd865986804becc99 Mon Sep 17 00:00:00 2001 From: gumi Date: Tue, 1 Oct 2019 17:20:46 -0400 Subject: [frob] allow to clean the db without removing items --- server/frob/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/frob/index.ts b/server/frob/index.ts index e1b3ce5..ea1e33b 100644 --- a/server/frob/index.ts +++ b/server/frob/index.ts @@ -84,6 +84,10 @@ const flags = { case "dry-run": flags.dry_run = true; break; + case "clean": + case "clean-only": + args.length = 0; + break; default: throw new SyntaxError(`unknown flag: ${opt}`); } @@ -96,6 +100,9 @@ const flags = { // item parsing for (let arg of args.join(",").split(",")) { + if (arg === null || arg.length < 1) + continue; + if (arg.includes("-") || arg.includes("..")) { const range = arg.split("-").join("..").split(".."); let from = itemToNumber(range[0]), to = itemToNumber(range[1]); -- cgit v1.2.3-70-g09d2