-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathansible-doc.ts
158 lines (156 loc) · 3.73 KB
/
ansible-doc.ts
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
const allPluginsGenerator: Fig.Generator = {
script: ["ansible-doc", "--list", "--json"],
postProcess: function (output) {
const plugins = JSON.parse(output);
return Object.keys(plugins).map((key) => ({
name: key,
description: plugins[key],
}));
},
};
const completionSpec: Fig.Spec = {
name: "ansible-doc",
description: "Displays information on modules installed in Ansible libraries",
options: [
{
name: "--metadata-dump",
description:
"For internal testing only Dump json metadata for all plugins",
args: {
isOptional: true,
},
},
{
name: "--playbook-dir",
description:
"Sets the relative path for many features including roles/ group_vars/ etc",
args: {
name: "BASEDIR",
description: "Base directory",
template: ["filepaths"],
},
},
{
name: "--version",
description:
"Shows version number, config file location, module search path, module location, executable location and exit",
args: {
isOptional: true,
},
},
{
name: ["--list_files", "-F"],
description:
"Show plugin names and their source files without summaries (implies --list)",
args: {
isOptional: true,
},
},
{
name: ["--module-path", "-M"],
description: "Prepend colon-separated path(s) to module library",
args: {
isOptional: true,
},
},
{
name: ["--entry-point", "-E"],
description: "Select the entry point for role(s)",
args: {
name: "ENTRY_POINT",
},
},
{
name: ["--help", "-h"],
description: "Show help and exit",
args: {
isOptional: true,
},
},
{
name: ["--json", "-j"],
description: "Change output into json format",
args: {
isOptional: true,
},
},
{
name: ["--list", "-l"],
description:
"List available plugins; a supplied argument will be used for filtering (can be a namespace or full collection name)",
args: {
name: "NAMESPACE|COLLECTION",
isOptional: true,
isDangerous: true,
},
},
{
name: ["--roles-path", "-r"],
description: "The path to the directory containing your roles",
args: {
name: "PATH",
template: ["filepaths"],
},
},
{
name: ["--snippet", "-s"],
description:
"Show playbook snippet for these plugin types: inventory, lookup, module",
args: {
name: "PLUGIN_TYPE",
suggestions: ["inventory", "lookup", "module"],
},
},
{
name: ["--type", "-t"],
description: 'Choose which plugin type (defaults to "module")',
args: {
name: "PLUGIN_TYPE",
suggestions: [
"become",
"cache",
"callback",
"cliconf",
"connection",
"httpapi",
"inventory",
"lookup",
"netconf",
"shell",
"vars",
"module",
"strategy",
"role",
"keyword",
],
default: "module",
},
},
{
name: "--verbose",
description:
"Verbose mode (-vvv for more, -vvvv to enable connection debugging)",
exclusiveOn: ["-v"],
args: {
isOptional: true,
},
},
{
name: "-v",
description:
"Verbose mode (-vvv for more, -vvvv to enable connection debugging)",
isRepeatable: 5,
exclusiveOn: ["--verbose"],
args: {
isOptional: true,
},
},
],
args: {
name: "plugin",
isDangerous: true,
isVariadic: true,
generators: allPluginsGenerator,
},
};
export default completionSpec;