mergestorm 0.3.56 → 0.3.57

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/README.md CHANGED
@@ -45,12 +45,12 @@ On a TTY, bare `mergestorm` (or `mergestorm shell`) opens a branded REPL: a comp
45
45
 
46
46
  ```
47
47
  ╭──────────────────────────────────────────────────────────────────────────────╮
48
- │ ▀▀▀▀▀▀▀▀▀▀▘ mergestorm v0.3.56 │
48
+ │ ▀▀▀▀▀▀▀▀▀▀▘ mergestorm v0.3.57 │
49
49
  │ ▀▀▀▀▀▀▀▀▀ ● msk_live_… · maelstrom │
50
50
  │ ▀▀▀▀▀▀ [████████░░░░░░░░░░░░░░░░░░░░░░] 25% used │
51
51
  │ ▝▀▀▀▀▀ local reviews + stacked PRs · mergestorm.ai │
52
52
  │ ▝▀▀▘ review a diff · usage for tabs · /help for all commands │
53
- │ ▀ New in v0.3.56: Set automation per repository │
53
+ │ ▀ New in v0.3.57: issue create --help shows the usage │
54
54
  ╰──────────────────────────────────────────────────────────────────────────────╯
55
55
  mergestorm
56
56
  ╭──────────────────────────────────────────────────────────────────────────────╮
@@ -9,6 +9,7 @@ export const ISSUE_USAGE = [
9
9
  " Opens a GitHub issue through Mergestorm as the Surge App. Needs no gh and no GitHub login.",
10
10
  " Uses existing labels only. Running it again with the same title returns the open issue it already made when that issue is among the newest 100 open issues; an older one, or two calls at once, can still create a duplicate.",
11
11
  ].join("\n");
12
+ const VALUE_FLAGS = new Set(["--title", "--body", "--body-file", "--label", "--repo"]);
12
13
  function usage(message) {
13
14
  return new CommandError(message ? `${message}\n${ISSUE_USAGE}` : ISSUE_USAGE, REVIEW_EXIT.usage, "usage");
14
15
  }
@@ -65,7 +66,18 @@ export function parseIssueCreateArgs(args, readBody = (path) => readFileSync(pat
65
66
  }
66
67
  export async function cmdIssue(args, deps = {}) {
67
68
  const sub = args[0]?.toLowerCase();
68
- if (!sub || sub === "-h" || sub === "--help" || sub === "help") {
69
+ const asksForHelp = (arg) => arg === "-h" || arg === "--help" || arg === "help";
70
+ const createAsksForHelp = (rest) => {
71
+ for (let i = 0; i < rest.length; i++) {
72
+ const arg = rest[i];
73
+ if (asksForHelp(arg))
74
+ return true;
75
+ if (VALUE_FLAGS.has(arg))
76
+ i++;
77
+ }
78
+ return false;
79
+ };
80
+ if (!sub || asksForHelp(sub) || (sub === "create" && createAsksForHelp(args.slice(1)))) {
69
81
  console.log(ISSUE_USAGE);
70
82
  return;
71
83
  }
package/dist/ui/banner.js CHANGED
@@ -206,6 +206,9 @@ const WHATS_NEW = {
206
206
  "0.3.56": [
207
207
  "Set automation per repository",
208
208
  ],
209
+ "0.3.57": [
210
+ "issue create --help shows the usage",
211
+ ],
209
212
  };
210
213
  function densityFromVariant(variant) {
211
214
  if (variant === "mini" || variant === "nano")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mergestorm",
3
- "version": "0.3.56",
3
+ "version": "0.3.57",
4
4
  "description": "Mergestorm CLI (mg) — local reviews & stacked PRs. MIT; build from source: https://github.com/marginsystems/mergestorm-cli",
5
5
  "license": "MIT",
6
6
  "type": "module",