-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathmdls.ts
105 lines (105 loc) · 3.1 KB
/
mdls.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
const completionSpec: Fig.Spec = {
name: "mdls",
description: "Lists the metadata attributes for the specified file",
parserDirectives: {
flagsArePosixNoncompliant: true,
},
args: {
name: "file",
template: "filepaths",
isVariadic: true,
},
options: [
{
name: ["--name", "-name"],
description:
"Print only the matching metadata attribute value. Can be used multiple times",
isRepeatable: true,
exclusiveOn: ["--plist", "-plist"],
args: {
name: "attributeName",
description: "Metadata attribute name",
suggestions: [
"_kMDItemDisplayNameWithExtensions",
"kMDItemContentCreationDate",
"kMDItemContentCreationDate_Ranking",
"kMDItemContentModificationDate",
"kMDItemContentModificationDate_Ranking",
"kMDItemContentType",
"kMDItemContentTypeTree",
"kMDItemDateAdded",
"kMDItemDateAdded_Ranking",
"kMDItemDisplayName",
"kMDItemDocumentIdentifier",
"kMDItemFSContentChangeDate",
"kMDItemFSCreationDate",
"kMDItemFSCreatorCode",
"kMDItemFSFinderFlags",
"kMDItemFSHasCustomIcon",
"kMDItemFSInvisible",
"kMDItemFSIsExtensionHidden",
"kMDItemFSIsStationery",
"kMDItemFSLabel",
"kMDItemFSName",
"kMDItemFSNodeCount",
"kMDItemFSOwnerGroupID",
"kMDItemFSOwnerUserID",
"kMDItemFSSize",
"kMDItemFSTypeCode",
"kMDItemInterestingDate_Ranking",
"kMDItemKind",
"kMDItemLogicalSize",
"kMDItemPhysicalSize",
],
},
},
{
name: ["--raw", "-raw"],
description:
"Print raw attribute data in the order that was requested. Fields will be separated with a ASCII NUL character, suitable for piping to xargs(1) -0",
exclusiveOn: ["--plist", "-plist"],
},
{
name: ["--nullMarker", "-nullMarker"],
description:
"Sets a marker string to be used when a requested attribute is null. Only used in -raw mode. Default is '(null)'",
insertValue: `--nullMarker "{cursor}"`,
dependsOn: ["--raw", "-raw"],
exclusiveOn: ["--plist", "-plist"],
},
// TODO(platform): macos only option
{
name: ["--plist", "-plist"],
description:
"Output attributes in XML format to file. Use - to write to stdout option. Incompatible with options -raw, -nullMarker, and -name",
exclusiveOn: [
"--raw",
"-raw",
"--nullMarker",
"-nullMarker",
"--name",
"-name",
],
args: [
{
name: "stdout or file",
description: "XML output location",
template: "filepaths",
suggestions: [
{
name: "-",
description: "Writes to stdout",
priority: 77,
},
],
},
{
name: "file",
description: "File to read from",
template: "filepaths",
},
],
},
],
};
export default completionSpec;