Skip to content

Commit 9334822

Browse files
committed
fix: correct parsing of the files without a flag
1 parent 2a1d078 commit 9334822

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/native/cli.d

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,20 @@ import argparse;
2323
)
2424
struct Options
2525
{
26-
@TrailingArguments string[] files;
2726
bool comment = false;
2827
string[] str;
2928
// (Deprecated) A list of files to minify (for backwards compatiblitity with getopt)
3029
string[] file;
3130
}
3231

33-
int actualMain(Options opts) @trusted
32+
int actualMain(Options opts, string[] files) @trusted
3433
{
3534
try
3635
{
3736
// minify the given files
38-
if (opts.files.length > 0 || opts.file.length > 0)
37+
if (files.length > 0 || opts.file.length > 0)
3938
{
40-
const auto files = opts.files ~ opts.file;
41-
minifyFiles(files, opts.comment);
39+
minifyFiles(files ~ opts.file, opts.comment);
4240
}
4341

4442
// minify the given string and print to stdout
@@ -62,4 +60,4 @@ int actualMain(Options opts) @trusted
6260
return 0;
6361
}
6462

65-
mixin CLI!Options.main!((args) { return actualMain(args); });
63+
mixin CLI!Options.main!((opts, unparsed) { return actualMain(opts, unparsed); });

0 commit comments

Comments
 (0)