command-parser/tests/CommandOption.test.js
Navy.gif c669d60428
All checks were successful
continuous-integration/drone/push Build is passing
default help option to commands and subcommands
bugfix for boolean type parse
2023-05-05 17:32:29 +03:00

29 lines
612 B
JavaScript

// import { Parser, Command, CommandOption, OptionType } from '../build/esm'
const {Parser, Command, CommandOption, OptionType} = require('../build/cjs')
const opt = new CommandOption({
name: 'text',
type: OptionType.STRING
});
class TestCommand extends Command {
constructor() {
super({
name: 'test',
options: [opt]
})
}
};
const parser = new Parser({
commands: [new TestCommand()],
resolver: null
});
(async () => {
const parsed = await parser.parseMessage('test message.author')
// console.log(parsed)
})();
test('', () => {
})