1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Cli; |
4: | |
5: | /** |
6: | * Command line option visibility flags |
7: | * |
8: | * @api |
9: | */ |
10: | interface CliOptionVisibility |
11: | { |
12: | /** |
13: | * Don't include the option in any help output |
14: | */ |
15: | public const NONE = 0; |
16: | |
17: | /** |
18: | * Include the option in command synopses |
19: | */ |
20: | public const SYNOPSIS = 1; |
21: | |
22: | /** |
23: | * Include the option when writing help to a terminal |
24: | */ |
25: | public const HELP = 2; |
26: | |
27: | /** |
28: | * Include the option when writing help as Markdown |
29: | */ |
30: | public const MARKDOWN = 4; |
31: | |
32: | /** |
33: | * Include the option when writing help as Markdown with man page extensions |
34: | */ |
35: | public const MAN_PAGE = 8; |
36: | |
37: | /** |
38: | * Include the option when generating shell completions |
39: | */ |
40: | public const COMPLETION = 16; |
41: | |
42: | /** |
43: | * Include the option when generating a JSON Schema |
44: | */ |
45: | public const SCHEMA = 32; |
46: | |
47: | /** |
48: | * Hide the option's default value if not writing help to a terminal |
49: | */ |
50: | public const HIDE_DEFAULT = 64; |
51: | |
52: | /** |
53: | * Show the option everywhere |
54: | * |
55: | * This is the default. |
56: | */ |
57: | public const ALL = |
58: | CliOptionVisibility::SYNOPSIS |
59: | | CliOptionVisibility::HELP |
60: | | CliOptionVisibility::MARKDOWN |
61: | | CliOptionVisibility::MAN_PAGE |
62: | | CliOptionVisibility::COMPLETION; |
63: | |
64: | /** |
65: | * Show the option everywhere except in command synopses |
66: | */ |
67: | public const ALL_EXCEPT_SYNOPSIS = |
68: | CliOptionVisibility::HELP |
69: | | CliOptionVisibility::MARKDOWN |
70: | | CliOptionVisibility::MAN_PAGE |
71: | | CliOptionVisibility::COMPLETION; |
72: | } |
73: |