Skip to content

Commit 03c6023

Browse files
authored
fix(deps): update cli-nano to latest and add CLI examples (#32)
1 parent e4051ac commit 03c6023

File tree

3 files changed

+67
-60
lines changed

3 files changed

+67
-60
lines changed

package-lock.json

Lines changed: 44 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@
5454
"test:coverage": "vitest --coverage --config ./vitest.config.mts"
5555
},
5656
"dependencies": {
57-
"cli-nano": "^1.1.3",
57+
"cli-nano": "^1.2.1",
5858
"tinyglobby": "^0.2.14",
5959
"untildify": "^5.0.0"
6060
},
6161
"devDependencies": {
62-
"@biomejs/biome": "^2.0.6",
62+
"@biomejs/biome": "^2.1.1",
6363
"@release-it/conventional-changelog": "^10.0.1",
64-
"@types/node": "^22.16.0",
64+
"@types/node": "^22.16.2",
6565
"@types/yargs": "^17.0.33",
6666
"@vitest/coverage-v8": "^3.2.4",
6767
"premove": "^4.0.0",
@@ -76,4 +76,4 @@
7676
"type": "ko_fi",
7777
"url": "https://ko-fi.com/ghiscoding"
7878
}
79-
}
79+
}

src/cli.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,25 @@ try {
2727
const config = {
2828
command: {
2929
name: 'copyfiles',
30-
description: 'Copy files from a source to a destination directory',
30+
describe: 'Copy files from a source to a destination directory',
31+
examples: [
32+
{ cmd: '$0 something/*.js out', describe: `if all the files are in a folder that you don't want in the path out path` },
33+
{
34+
cmd: '$0 something/*.js out -u 1',
35+
describe: 'which would put all the js files in `"out/something"`, you can use the `--up` (or `-u`) option',
36+
},
37+
],
3138
positionals: [
3239
{
3340
name: 'inFile',
34-
description: 'Source file(s)',
41+
describe: 'Source file(s)',
3542
type: 'string',
3643
variadic: true,
3744
required: true,
3845
},
3946
{
4047
name: 'outDirectory',
41-
description: 'Destination directory',
48+
describe: 'Destination directory',
4249
required: true,
4350
type: 'string',
4451
},
@@ -48,47 +55,47 @@ try {
4855
all: {
4956
alias: 'a',
5057
type: 'boolean',
51-
description: 'Include files & directories begining with a dot (.)',
58+
describe: 'Include files & directories begining with a dot (.)',
5259
},
5360
dryRun: {
5461
alias: 'd',
5562
type: 'boolean',
56-
description: 'Show what would be copied, but do not actually copy any files',
63+
describe: 'Show what would be copied, but do not actually copy any files',
5764
},
5865
error: {
5966
alias: 'E',
6067
type: 'boolean',
61-
description: 'Throw error if nothing is copied',
68+
describe: 'Throw error if nothing is copied',
6269
},
6370
exclude: {
6471
alias: 'e',
6572
type: 'array',
66-
description: 'Pattern or glob to exclude (may be passed multiple times)',
73+
describe: 'Pattern or glob to exclude (may be passed multiple times)',
6774
},
6875
flat: {
6976
alias: 'f',
7077
type: 'boolean',
71-
description: 'Flatten the output',
78+
describe: 'Flatten the output',
7279
},
7380
follow: {
7481
alias: 'F',
7582
type: 'boolean',
76-
description: 'Follow symbolink links',
83+
describe: 'Follow symbolink links',
7784
},
7885
stat: {
7986
alias: 's',
8087
type: 'boolean',
81-
description: 'Show statistics after execution (execution time + file count)',
88+
describe: 'Show statistics after execution (execution time + file count)',
8289
},
8390
up: {
8491
alias: 'u',
8592
type: 'number',
86-
description: 'Slice a path off the bottom of the paths',
93+
describe: 'Slice a path off the bottom of the paths',
8794
},
8895
verbose: {
8996
alias: 'V',
9097
type: 'boolean',
91-
description: 'Print more information to console',
98+
describe: 'Print more information to console',
9299
},
93100
},
94101
version: readPackage().version,

0 commit comments

Comments
 (0)