# view source
example/basic.ts
import { arg, decarg } from 'decarg'
class Options {
@arg('<file> [<file>, decarg.]', 'Files to process') file!: string[]
@arg('--', '[decarg.rest]', 'The rest of the arguments') passArgs = []
@arg('-f', '--flag', 'Flag about something') flag = false
@arg('-c', '--count', 'How many times') count = 42
@arg('-C', 'Choose color', ['blue', 'red', 'yellow']) color = 'blue'
@arg('-s', '--string', 'Some string') string = 'hmm'
@arg('--meh', 'Meh') meh: string[] = []
static examples = {
'-f foo': 'Convert foo by force',
'-f foo -s': 'Convert foo by force smoothly',
}
}
const options = decarg(new Options())
console.log(options)