Skip to content

Commit 8da8331

Browse files
kiprasmeldanieldelcore
authored andcommitted
feat: allow specifying multiple transforms
maybe would be nicer if the interface would be `-t t1 -t t2 -t t3` instead of current `-t t1,t2,t3` (you could separate into multiple lines and keep it cleaner), but don't know how to do that so this works just fine. Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 26e4a04 commit 8da8331

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/cli/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ program
1616
.usage('[global options] <file-paths>...')
1717
.option(
1818
'-t, --transform <value>',
19-
'The transform to run, will prompt for a transform if not provided and no module is passed',
19+
'The transform(s) to run, will prompt for a transform if not provided and no module is passed\nTo provide multiple transforms, separate them with commas (e.g. "-t t1,t2,t3")',
2020
)
2121
.option(
2222
'--packages <value>',

packages/cli/src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ export default async function main(paths: string[], flags: Flags) {
9494
}
9595

9696
if (flags.transform) {
97-
transforms.push(flags.transform);
97+
if (flags.transform.includes(',')) {
98+
flags.transform.split(',').forEach(t => transforms.push(t.trim()));
99+
} else {
100+
transforms.push(flags.transform);
101+
}
98102
}
99103

100104
if (flags.packages) {

0 commit comments

Comments
 (0)