pmpt-cli 1.9.0 → 1.9.1

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.
@@ -74,16 +74,23 @@ function printSummary(diffs) {
74
74
  p.log.info(`${pc.green(`+${additions}`)} additions, ${pc.red(`-${deletions}`)} deletions`);
75
75
  }
76
76
  export function cmdDiff(v1, v2, pathOrOptions, maybeOptions) {
77
- // Commander passes args differently depending on how many positionals are given.
78
- // pmpt diff v1 --file x → (v1, options)
79
- // pmpt diff v1 v2 → (v1, v2, options)
80
- // pmpt diff v1 v2 /path → (v1, v2, path, options)
77
+ // Commander passes args in order: pmpt diff v1 [v2] [path] [options]
78
+ // Smart parsing: if v2 looks like a path (not a version pattern), treat it as path.
81
79
  let v2Str;
82
80
  let path;
83
81
  let options = {};
82
+ const isVersion = (s) => /^v?\d+$/.test(s);
84
83
  if (typeof v2 === 'object') {
84
+ // pmpt diff v1 --file x → (v1, options)
85
85
  options = v2;
86
86
  }
87
+ else if (v2 !== undefined && !isVersion(v2)) {
88
+ // pmpt diff v1 /some/path → v2 is actually a path
89
+ path = v2;
90
+ if (typeof pathOrOptions === 'object') {
91
+ options = pathOrOptions;
92
+ }
93
+ }
87
94
  else {
88
95
  v2Str = v2;
89
96
  if (typeof pathOrOptions === 'object') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmpt-cli",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Record and share your AI-driven product development journey",
5
5
  "type": "module",
6
6
  "bin": {