|
|
|
@ -32,6 +32,16 @@ const check = (test, fail_message) => { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
+ FOOTGUN: commander tries to be "fancy" and if you don't have |
|
|
|
|
an `arguments` setting for positional arguments then you |
|
|
|
|
have to change this to `(opts)` instead of `(arg, opts)`. |
|
|
|
|
The reason is if your command doesn't have an argument, then |
|
|
|
|
commander will call your main with only opts, and if it does |
|
|
|
|
then it calls your main with arg, and opts. If you get weird |
|
|
|
|
errors and `opts` looks like a `Command` object then this is |
|
|
|
|
what happened. |
|
|
|
|
*/ |
|
|
|
|
export const main = async (arg, opts) => { |
|
|
|
|
// if they give an numeric option this is how you can convert it
|
|
|
|
|
// yes, this is annoying and commander should handle it but oh well
|
|
|
|
|