UNPKG

wikibase-cli

Version:

A command-line interface to Wikibase

16 lines (14 loc) 635 B
#!/usr/bin/env node import program from 'commander' import { commandWithTemplateCustomHelp } from '#lib/command_with_template_custom_help' import { execEditCommand } from '#lib/edit/edit_command' import { parseGuid } from '#lib/parse_command_utils' import { polymorphicCommandArgsParser } from '#lib/polymorphic_command_args_parser' const inlineArgsParser = ([ guid, hash ]) => { guid = parseGuid(guid) hash = hash.split('|') return [ { guid, hash } ] } program.customArgsParser = polymorphicCommandArgsParser({ inlineArgsParser }) program.customHelpOption = commandWithTemplateCustomHelp execEditCommand('reference', 'remove')