1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Cli; |
4: | |
5: | /** |
6: | * Command line option types |
7: | * |
8: | * @api |
9: | */ |
10: | interface CliOptionType |
11: | { |
12: | /** |
13: | * Enable a setting |
14: | * |
15: | * Examples: |
16: | * |
17: | * - `-v` |
18: | * - `--verbose` |
19: | */ |
20: | public const FLAG = 0; |
21: | |
22: | /** |
23: | * Set a value |
24: | * |
25: | * Examples: |
26: | * |
27: | * - `-v <level>` |
28: | * - `--verbosity <level>` |
29: | */ |
30: | public const VALUE = 1; |
31: | |
32: | /** |
33: | * Set a value, or don't |
34: | * |
35: | * Examples (note the lack of whitespace): |
36: | * |
37: | * - `-v<level>` |
38: | * - `--verbosity=<level>` |
39: | */ |
40: | public const VALUE_OPTIONAL = 2; |
41: | |
42: | /** |
43: | * Set the value of a positional parameter |
44: | */ |
45: | public const VALUE_POSITIONAL = 3; |
46: | |
47: | /** |
48: | * Choose from a list of values |
49: | * |
50: | * Examples: |
51: | * |
52: | * - `-f (yes|no|ask)` |
53: | * - `--force (yes|no|ask)` |
54: | */ |
55: | public const ONE_OF = 4; |
56: | |
57: | /** |
58: | * Choose from a list of values, or don't |
59: | * |
60: | * Examples (note the lack of whitespace): |
61: | * |
62: | * - `-f(yes|no|ask)` |
63: | * - `--force=(yes|no|ask)` |
64: | */ |
65: | public const ONE_OF_OPTIONAL = 5; |
66: | |
67: | /** |
68: | * Choose the value of a positional parameter from a list |
69: | */ |
70: | public const ONE_OF_POSITIONAL = 6; |
71: | } |
72: |