@enrichlayer/el-linear 1.37.0 → 1.37.2

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.
@@ -11,3 +11,26 @@ export function getRootOpts(command) {
11
11
  // biome-ignore lint/style/noNonNullAssertion: command.parent / .parent.parent are guaranteed by commander inside subcommand actions; see docstring
12
12
  return (command.parent?.parent ?? command.parent).opts();
13
13
  }
14
+ /**
15
+ * Resolve an option that is registered on BOTH the root program and a
16
+ * subcommand (`--format` / `--fields` on `issues list|search`,
17
+ * `projects list`).
18
+ *
19
+ * Commander 15 hands a same-named option to the OUTERMOST registration
20
+ * even when it appears after the subcommand: `issues list --format table`
21
+ * sets the program's global `--format` and leaves the subcommand's local
22
+ * option at its default, so handlers reading `options.format` silently
23
+ * saw `"json"` (DEV-5376). Precedence here: local CLI-set value, then the
24
+ * nearest ancestor's CLI-set value, then the local default.
25
+ */
26
+ export function effectiveOption(command, key) {
27
+ if (command.getOptionValueSource(key) === "cli") {
28
+ return command.getOptionValue(key);
29
+ }
30
+ for (let c = command.parent; c; c = c.parent) {
31
+ if (c.getOptionValueSource(key) === "cli") {
32
+ return c.getOptionValue(key);
33
+ }
34
+ }
35
+ return command.getOptionValue(key);
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enrichlayer/el-linear",
3
- "version": "1.37.0",
3
+ "version": "1.37.2",
4
4
  "description": "A pragmatic CLI for Linear.app — deterministic team/label/member resolution, structured issue validation, configurable term enforcement, and a GraphQL escape hatch.",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",