-
-
Notifications
You must be signed in to change notification settings - Fork 19
Description
There is some code that is unfortunately a bit complex, because we're trying to support both -n
and --no-newline
flags and this is a little tricky with the current state of meow and yargs-parser (which meow uses).
The line looks like this:
if (!cli.flags.noNewline && cli.flags.newline !== false) {
process.stdout.write('\n');
}
There are two conditions in the if
statement:
cli.flags.noNewline
is set when-n
is passed.cli.flags.newline
is set tofalse
when--no-newline
is passed.
The hope is that this complexity will be temporary and that the code can be refactored in the future, possibly along with some changes to either meow or yargs-parser, which meow uses.
We might be able to simplify this in the future if we use the boolean-negation
feature in yargs-parser (see #16 (comment)) or if yargs-parser has or develops some way of indicating that a short flag is a negative flag (e.g.: -n
sets a newline
flag to false, just as --no-newline
does).