diff options
author | gumi <git@gumi.ca> | 2019-10-01 17:20:46 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2019-10-01 17:20:46 -0400 |
commit | 26549ea92723843a8522705dd865986804becc99 (patch) | |
tree | 6c4617b81bccc87d9066e7cb6b9b9955d2a3c1b5 /server | |
parent | d34c1169ac71a0d3869b8fe9fb471ae2e135506b (diff) | |
download | tools-26549ea92723843a8522705dd865986804becc99.tar.gz tools-26549ea92723843a8522705dd865986804becc99.tar.bz2 tools-26549ea92723843a8522705dd865986804becc99.tar.xz tools-26549ea92723843a8522705dd865986804becc99.zip |
[frob] allow to clean the db without removing items
Diffstat (limited to 'server')
-rw-r--r-- | server/frob/index.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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]); |