@willh/copilotstatusline 0.2.1 → 0.2.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.
package/README.md CHANGED
@@ -53,7 +53,8 @@ copilotstatusline --install global Install a global binary command
53
53
  copilotstatusline --uninstall Remove an owned integration
54
54
  copilotstatusline --check Print integration status as JSON
55
55
  copilotstatusline --config <path> Use a custom formatter settings file
56
- copilotstatusline --version Print the package version
56
+ copilotstatusline -h Print help (alias: --help)
57
+ copilotstatusline -v Print the package version (alias: --version)
57
58
  ```
58
59
 
59
60
  When `--config` is combined with `--install`, the absolute config path is included in Copilot's command setting.
@@ -54312,7 +54312,7 @@ var package_default;
54312
54312
  var init_package = __esm(() => {
54313
54313
  package_default = {
54314
54314
  name: "@willh/copilotstatusline",
54315
- version: "0.2.1",
54315
+ version: "0.2.2",
54316
54316
  bugs: {
54317
54317
  url: "https://github.com/doggy8088/copilotstatusline/issues"
54318
54318
  },
@@ -56408,6 +56408,28 @@ var init_tui = __esm(async () => {
56408
56408
  import_react34 = __toESM(require_react(), 1);
56409
56409
  });
56410
56410
 
56411
+ // src/cli-options.ts
56412
+ var HELP_TEXT = `Usage: copilotstatusline [options]
56413
+
56414
+ Render a GitHub Copilot CLI status payload from stdin. When stdin is a TTY,
56415
+ open the interactive configuration UI instead.
56416
+
56417
+ Options:
56418
+ -h, --help Show this help message
56419
+ -v, --version Show the package version
56420
+ --config <path> Use a custom formatter settings file
56421
+ --check Print Copilot CLI integration status as JSON
56422
+ --install [mode] Install the integration using npm, bunx, or global
56423
+ --uninstall Remove an integration owned by this package`;
56424
+ function takeFlag(args, ...names) {
56425
+ const index = args.findIndex((argument) => names.includes(argument));
56426
+ if (index < 0) {
56427
+ return false;
56428
+ }
56429
+ args.splice(index, 1);
56430
+ return true;
56431
+ }
56432
+
56411
56433
  // src/types/copilot-status.ts
56412
56434
  init_zod();
56413
56435
  var numberValue = exports_external.preprocess((value) => {
@@ -56513,7 +56535,7 @@ function normalizeCopilotStatus(status) {
56513
56535
  init_app_settings();
56514
56536
  init_copilot_settings();
56515
56537
  init_renderer();
56516
- var PACKAGE_VERSION = "0.2.1";
56538
+ var PACKAGE_VERSION = "0.2.2";
56517
56539
  async function readStdin() {
56518
56540
  process.stdin.setEncoding("utf8");
56519
56541
  const chunks = [];
@@ -56534,14 +56556,6 @@ function takeOption(name) {
56534
56556
  process.argv.splice(index, 2);
56535
56557
  return value;
56536
56558
  }
56537
- function hasFlag2(name) {
56538
- const index = process.argv.indexOf(name);
56539
- if (index < 0) {
56540
- return false;
56541
- }
56542
- process.argv.splice(index, 1);
56543
- return true;
56544
- }
56545
56559
  async function renderPipedStatus() {
56546
56560
  const input = await readStdin();
56547
56561
  if (input.trim() === "") {
@@ -56563,7 +56577,7 @@ async function renderPipedStatus() {
56563
56577
  }
56564
56578
  }
56565
56579
  async function runCommandMode() {
56566
- if (hasFlag2("--check")) {
56580
+ if (takeFlag(process.argv, "--check")) {
56567
56581
  const status = await inspectCopilotIntegration();
56568
56582
  console.log(JSON.stringify(status, null, 2));
56569
56583
  return true;
@@ -56579,7 +56593,7 @@ async function runCommandMode() {
56579
56593
  console.log(`Installed copilotstatusline through ${candidate}.`);
56580
56594
  return true;
56581
56595
  }
56582
- if (hasFlag2("--uninstall")) {
56596
+ if (takeFlag(process.argv, "--uninstall")) {
56583
56597
  const removed = await uninstallCopilotStatusLine();
56584
56598
  console.log(removed ? "Removed copilotstatusline from Copilot CLI settings." : "Copilot CLI is not configured to use copilotstatusline.");
56585
56599
  return true;
@@ -56587,7 +56601,11 @@ async function runCommandMode() {
56587
56601
  return false;
56588
56602
  }
56589
56603
  async function main() {
56590
- if (hasFlag2("--version")) {
56604
+ if (takeFlag(process.argv, "-h", "--help")) {
56605
+ console.log(HELP_TEXT);
56606
+ return;
56607
+ }
56608
+ if (takeFlag(process.argv, "-v", "--version")) {
56591
56609
  console.log(PACKAGE_VERSION);
56592
56610
  return;
56593
56611
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willh/copilotstatusline",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "bugs": {
5
5
  "url": "https://github.com/doggy8088/copilotstatusline/issues"
6
6
  },