@franzzemen/brokenstock-shell 0.7.0 → 0.7.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.
@@ -2916,7 +2916,10 @@ class CommandService {
2916
2916
  return notLoggedIn();
2917
2917
  }
2918
2918
  if (hasHelp) {
2919
- return { success: true, message: def.usage, timestamp: new Date(), isHelp: true };
2919
+ // `help <command>` is normalised to `<command> help` above, so this is
2920
+ // the one place a command's usage is shown; the screen it works on goes
2921
+ // here (D31).
2922
+ return { success: true, message: def.usage + this.#whereNote(def.scope), timestamp: new Date(), isHelp: true };
2920
2923
  }
2921
2924
  // Screen gate (trades-tree.prd.md D30). A command bound to state only one
2922
2925
  // screen sets is refused off that screen with the screen named, the way
@@ -2961,8 +2964,11 @@ class CommandService {
2961
2964
  // user decides whether it's worth unlocking. The gate is noted, not enforced.
2962
2965
  const availability = def.isAvailable?.();
2963
2966
  const note = availability && !availability.ok ? `\n\nCurrently unavailable — ${availability.reason}` : '';
2964
- const where = def.scope === 'global' ? '' : `\n\nWorks on ${def.scope.screen}.`;
2965
- return { success: true, message: def.usage + where + note, timestamp: new Date(), isHelp: true };
2967
+ return { success: true, message: def.usage + this.#whereNote(def.scope) + note, timestamp: new Date(), isHelp: true };
2968
+ }
2969
+ /** "Works on the Trades screen." — appended to a scoped command's usage. */
2970
+ #whereNote(scope) {
2971
+ return scope === 'global' ? '' : `\n\nWorks on ${scope.screen}.`;
2966
2972
  }
2967
2973
  /** `help`'s annotation for a command scoped to a screen other than the current one. */
2968
2974
  #scopeSuffix(scope) {