repo-util 1.24.55 → 1.24.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-util",
3
- "version": "1.24.55",
3
+ "version": "1.24.56",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -24,6 +24,17 @@ const properties = {};
24
24
  program
25
25
  .description(pkg.description)
26
26
  .version(pkg.version)
27
+ .option("--no-cache", "cache requests")
28
+ .option("--statistics", "show cache statistics")
29
+ .option("--trace", "log level trace")
30
+ .option("--debug", "log level debug")
31
+ .option(
32
+ "--no-identifier",
33
+ "do not output identifier, show attribute values only"
34
+ )
35
+ .option("-a, --attribute <attributes>", "list attribute", a => a.split(","))
36
+ .option("--no-undefined", "do not output undefined attribute values")
37
+ .option("--json", "output as json")
27
38
  .option("-D --define <a=b>", "define property", str =>
28
39
  Object.assign(properties, Object.fromEntries([str.split(/=/)]))
29
40
  );
@@ -74,26 +85,11 @@ for (const o of [
74
85
  })
75
86
  ]) {
76
87
  const command = program.command(`${o[0]} [name...]`);
77
- command
78
- .option("--trace", "log level trace")
79
- .option("--debug", "log level debug")
80
- .option("--no-cache", "cache requests")
81
- .option("--statistics", "show cache statistics")
82
- .option("--json", "output as json")
83
- .option(
84
- "--no-identifier",
85
- "do not output identifier, show attribute values only"
86
- )
87
- .option("--no-undefined", "do not output undefined attribute values")
88
- .option("-a, --attribute <attributes>", "list attribute", a =>
89
- a.split(",")
90
- );
91
88
 
92
89
  command.action(async (names, options) =>
93
90
  list(
94
91
  provider,
95
92
  names,
96
- options,
97
93
  o[1],
98
94
  options.attribute ? options.attribute : o[2],
99
95
  actions
@@ -156,7 +152,9 @@ function listAttributes(object, attributes, options) {
156
152
  }
157
153
  }
158
154
 
159
- async function list(provider, names, options, slot, attributes, actions) {
155
+ async function list(provider, names, slot, attributes, actions) {
156
+ const options = program.optsWithGlobals();
157
+
160
158
  const json = [];
161
159
 
162
160
  for await (const object of provider[slot](normalize(names))) {