-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathpasswd.ts
46 lines (44 loc) · 1.17 KB
/
passwd.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
const generateUsers: Fig.Generator = {
script: ["bash", "-c", "dscl . -list /Users | grep -E -v '^_'"],
postProcess: (out) =>
out
.trim()
.split("\n")
.map((name) => ({ name, icon: "👤" })),
};
const completionSpec: Fig.Spec = {
name: "passwd",
description: "Modify a user's password",
options: [
{
name: "-i",
description: "Specify where the password update should be applied",
args: {
name: "infosystem",
description: "The directory system",
suggestions: ["PAM", "opendirectory", "file", "nis"],
},
},
{
name: "-l",
description:
"Causes the password to be updated in the given location of the chosen directory system",
args: {
name: "location",
description: "The location of the chosen directory system",
template: ["filepaths", "folders"],
},
},
{
name: "-u",
description:
"Specify the user name to use when authenticating to the directory node",
args: {
name: "authname",
description: "The user name",
generators: generateUsers,
},
},
],
};
export default completionSpec;