mirror of
https://github.com/astefanutti/decktape.git
synced 2025-01-05 21:23:15 +03:00
Display options before positional arguments in help and usage
This commit is contained in:
parent
1c9608d00d
commit
c63aa7f192
@ -348,6 +348,16 @@ ArgParser.prototype = {
|
||||
return opt.position === undefined;
|
||||
});
|
||||
|
||||
if (options.length) {
|
||||
if (!this._nocolors) {
|
||||
// must be a better way to do this
|
||||
str += chalk.blue(" [options]");
|
||||
}
|
||||
else {
|
||||
str += " [options]";
|
||||
}
|
||||
}
|
||||
|
||||
// assume there are no gaps in the specified pos. args
|
||||
positionals.forEach(function(pos) {
|
||||
if (!pos.hidden) {
|
||||
@ -368,16 +378,6 @@ ArgParser.prototype = {
|
||||
}
|
||||
});
|
||||
|
||||
if (options.length) {
|
||||
if (!this._nocolors) {
|
||||
// must be a better way to do this
|
||||
str += chalk.blue(" [options]");
|
||||
}
|
||||
else {
|
||||
str += " [options]";
|
||||
}
|
||||
}
|
||||
|
||||
if (options.length || positionals.length) {
|
||||
str += "\n\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user