forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandLineDefinition.ts
More file actions
67 lines (57 loc) · 2.21 KB
/
CommandLineDefinition.ts
File metadata and controls
67 lines (57 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
/**
* For use with CommandLineParser, this interface represents a generic command-line parameter
*/
export interface IBaseCommandLineDefinition {
/**
* The long name of the flag including double dashes, e.g. "--do-something"
*/
parameterLongName: string;
/**
* An optional short name for the flag including the dash, e.g. "-d"
*/
parameterShortName?: string;
/**
* Documentation for the flag, that will be shown when invoking the tool with "--help"
*/
description: string;
}
export interface IKeyedCommandLineDefinition extends IBaseCommandLineDefinition {
/**
* The key used to identify the value of this parameter. This must be a unique value. If it is
* omitted, a unique key is created. This key name appears in the help menu.
* For certain definitions, the key value is not surfaced in the UI.
*/
key?: string;
}
/**
* For use with CommandLineParser, this interface represents a boolean flag command line parameter
*/
export interface ICommandLineFlagDefinition extends IBaseCommandLineDefinition { }
/**
* For use with CommandLineParser, this interface represents a string command line parameter
*/
export interface ICommandLineStringDefinition extends IKeyedCommandLineDefinition { }
/**
* For use with CommandLineParser, this interface represents a string command line parameter
*/
export interface ICommandLineStringListDefinition extends IKeyedCommandLineDefinition { }
/**
* For use with CommandLineParser, this interface represents a parameter which is constrained to
* a list of possible options
*/
export interface ICommandLineOptionDefinition extends IBaseCommandLineDefinition {
/**
* A list of strings (which contain no spaces), of possible options which can be selected
*/
options: string[];
/**
* The default value which will be used if the parameter is omitted from the command line
*/
defaultValue?: string;
}
/**
* For use with CommandLineParser, this interface represents an integer command line parameter
*/
export interface ICommandLineIntegerDefinition extends IKeyedCommandLineDefinition { }