diff --git a/coverage/coverage.txt b/coverage/coverage.txt
index 458280e..daf072e 100644
--- a/coverage/coverage.txt
+++ b/coverage/coverage.txt
@@ -1,7 +1,7 @@
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
-All files | 100 | 94.2 | 100 | 100 |
- cli.mts | 100 | 100 | 100 | 100 |
- main.mts | 100 | 92.15 | 100 | 100 | 154-155
+All files | 99.04 | 93.24 | 100 | 99.04 |
+ cli.mts | 97.98 | 95 | 100 | 97.98 | 139-141
+ main.mts | 100 | 92.59 | 100 | 100 | 156-157
----------|---------|----------|---------|---------|-------------------
diff --git a/coverage/lcov-report/cli.mts.html b/coverage/lcov-report/cli.mts.html
index d3b836c..968fdb8 100644
--- a/coverage/lcov-report/cli.mts.html
+++ b/coverage/lcov-report/cli.mts.html
@@ -23,16 +23,16 @@
- 100%
+ 97.98%
Statements
- 133/133
+ 146/149
- 100%
+ 95%
Branches
- 18/18
+ 19/20
@@ -44,9 +44,9 @@
- 100%
+ 97.98%
Lines
- 133/133
+ 146/149
@@ -196,7 +196,23 @@
131
132
133
-
1341x
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150 | 1x
1x
1x
1x
@@ -272,6 +288,12 @@
1x
1x
1x
+1x
+1x
+1x
+1x
+1x
+21x
21x
21x
21x
@@ -324,6 +346,16 @@
21x
21x
21x
+21x
+21x
+21x
+191x
+
+
+
+191x
+21x
+21x
1x
1x
1x
@@ -357,11 +389,14 @@
export enum Option {
dest = "dest",
list = "list",
+ prefix = "prefix",
colors = "colors",
caseInsensitive = "caseInsensitive",
conflictsOnly = "conflictsOnly",
keepIf = "keepIf",
quiet = "quiet",
+ help = "help",
+ version = "version",
}
export const helpText = `
@@ -378,6 +413,8 @@
-l, --list List files. Useful as a dry run and with fzf. Does not
download. Will show show conflicts for the current
working directory if -d / --dest is not specified.
+ -p, --prefix Append the owner/repo prefix to the path in list output
+ Useful for feeding back into ${ name }.
-c, --conflicts-only Only show conflicts when listing.
-d, --dest <folder> Destination folder. Defaults to the current directory.
-i, --case-insensitive Ignores case when checking for conflicts. Default is
@@ -413,6 +450,10 @@
type: "boolean",
shortFlag: "l",
},
+ [Option.prefix]: {
+ type: "boolean",
+ shortFlag: "p",
+ },
[Option.colors]: {
type: "boolean",
default: !noColor(),
@@ -434,11 +475,11 @@
type: "string",
choices: ["newer", "existing"],
},
- help: {
+ [Option.help]: {
type: "boolean",
shortFlag: "h",
},
- version: {
+ [Option.version]: {
type: "boolean",
shortFlag: "v",
},
@@ -455,6 +496,13 @@
// to undefined--which the spread operator ignores.
...(argv && { argv }),
});
+
+ for (const flag of Object.keys(cli.flags)) {
+ if (!(flag in Option)) {
+ console.error(`\nError: Uknown flag "${ flag }". Run ${ name } -h to show help.\n`);
+ process.exit(1);
+ }
+ }
if (cli.input.length === 0) {
console.error(`\nError: Need at least one path. Run ${ name } -h to show help.\n`);
@@ -469,7 +517,7 @@
|