Compare commits

...

2 Commits

Author SHA1 Message Date
Rene Saarsoo da62a0f5c6 v2.3.0 2022-03-30 14:11:23 +03:00
Rene Saarsoo 1a0d26f4ca Read file from stdin 2022-03-30 14:10:57 +03:00
2 changed files with 6 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "zwiftout", "name": "zwiftout",
"version": "2.2.0", "version": "2.3.0",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"description": "Zwift workout generator command line tool and library", "description": "Zwift workout generator command line tool and library",
"author": "Rene Saarsoo <github@triin.net>", "author": "Rene Saarsoo <github@triin.net>",

View File

@ -17,13 +17,10 @@ export const parseCliOptions = (): CliOptions => {
default: false, default: false,
}); });
argParser.add_argument("file", { nargs: 1 }); argParser.add_argument("file", {
nargs: "?",
default: 0, // Default to reading STDIN
});
// As we only allow one file as input, return argParser.parse_args();
// convert filenames array to just a single string.
const { file, ...rest } = argParser.parse_args();
return {
file: file[0],
...rest,
};
}; };