@kud/foxhop-cli 1.1.0 → 1.1.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.
- package/dist/cli.js +11 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -492,8 +492,8 @@ var add = defineCommand({
|
|
|
492
492
|
args: {
|
|
493
493
|
url: {
|
|
494
494
|
type: "positional",
|
|
495
|
-
required:
|
|
496
|
-
description: "URL of the tab (e.g. https://gemini.google.com)"
|
|
495
|
+
required: false,
|
|
496
|
+
description: "URL of the tab (e.g. https://gemini.google.com) \u2014 or use --match"
|
|
497
497
|
},
|
|
498
498
|
name: {
|
|
499
499
|
type: "string",
|
|
@@ -515,13 +515,19 @@ var add = defineCommand({
|
|
|
515
515
|
favorite: { type: "boolean", description: "Pin to the top of the list" }
|
|
516
516
|
},
|
|
517
517
|
run: ({ args }) => {
|
|
518
|
-
const url = String(args.url);
|
|
519
|
-
const
|
|
518
|
+
const url = args.url ? String(args.url) : void 0;
|
|
519
|
+
const matchArg = args.match ? String(args.match) : void 0;
|
|
520
|
+
const source = url ?? matchArg;
|
|
521
|
+
if (!source) {
|
|
522
|
+
console.error("foxhop: provide a URL or --match");
|
|
523
|
+
process.exit(1);
|
|
524
|
+
}
|
|
525
|
+
const derived = deriveTarget(source);
|
|
520
526
|
const name = args.name ?? derived.name;
|
|
521
527
|
const existing = findTarget(readConfig(), name);
|
|
522
528
|
upsertTarget({
|
|
523
529
|
name,
|
|
524
|
-
match:
|
|
530
|
+
match: matchArg ?? derived.match,
|
|
525
531
|
url,
|
|
526
532
|
title: args.title ?? derived.title,
|
|
527
533
|
strategy: args.strategy,
|