You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import {CLIOption} from './CLIOption'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A positional CLI option. Defined without a flag.
|
|
|
|
*/
|
|
|
|
export class PositionalOption<T> extends CLIOption<T> {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Instantiate the option.
|
|
|
|
* @param {string} name - the name of the option
|
|
|
|
* @param {string} message - message describing the option
|
|
|
|
*/
|
|
|
|
constructor(
|
|
|
|
/**
|
|
|
|
* The display name of this positional argument.
|
|
|
|
* @example path, filename
|
|
|
|
*/
|
|
|
|
public readonly name: string,
|
|
|
|
/**
|
|
|
|
* A usage message describing this parameter.
|
|
|
|
*/
|
|
|
|
public readonly message: string = '',
|
|
|
|
) {
|
|
|
|
super()
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the name of the option.
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
|
|
|
getArgumentName(): string {
|
|
|
|
return this.name
|
|
|
|
}
|
|
|
|
}
|