this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

CLI: Allow deleting labels without going through prompt

futurGH 19c829c4 66bb9081

+14 -12
+14 -12
src/bin.ts
··· 19 19 import { loginAgent } from "./scripts/util.js"; 20 20 import { resolveHandle } from "./util/resolveHandle.js"; 21 21 22 - const args = process.argv.slice(2); 23 - const [command, subcommand] = args; 22 + const argv = process.argv.slice(2); 23 + const [command, subcommand, ...args] = argv; 24 24 25 25 if (command === "setup" || command === "clear") { 26 26 const credentials = await promptCredentials(); ··· 126 126 process.exit(0); 127 127 } 128 128 129 - const { identifiers } = await prompt({ 130 - type: "multiselect", 131 - name: "identifiers", 132 - message: "Select the labels to remove", 133 - min: 1, 134 - choices: labelDefinitions.map((def) => ({ 135 - title: def.locales[0].name, 136 - value: def.identifier, 137 - })), 138 - }, { onCancel: () => process.exit(1) }); 129 + const identifiers = args.length 130 + ? args 131 + : (await prompt({ 132 + type: "multiselect", 133 + name: "identifiers", 134 + message: "Select the labels to remove", 135 + min: 1, 136 + choices: labelDefinitions.map((def) => ({ 137 + title: def.locales[0].name, 138 + value: def.identifier, 139 + })), 140 + }, { onCancel: () => process.exit(1) })).identifiers; 139 141 140 142 const [newDefinitions, removedIdentifiers] = labelDefinitions.reduce< 141 143 [Array<ComAtprotoLabelDefs.LabelValueDefinition>, Array<string>]