command-line-basics
Advanced tools
Comparing version 0.5.2 to 0.5.3
# CHANGES for command-line-basics | ||
## 0.5.3 | ||
- Fix: Avoid duplication, e.g., if `sections` is borrowing from `definitions` | ||
## 0.5.2 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "command-line-basics", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Auto-add help and version CLI and update notification checks", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -89,1 +89,10 @@ # command-line-basics | ||
``` | ||
There is also exported an `autoAdd` method which takes the same arguments | ||
and returns the (potentially `help`/`version` and `header` enhanced) | ||
`definitions` and `sections`. It is also used internally by `cliBasics`. | ||
## To-dos | ||
1. Could auto-add `content` based on `pkg.description` and `Options` as | ||
`sections[1].header`. |
@@ -46,3 +46,7 @@ 'use strict'; | ||
optionDefinitions.push(versionInfo); | ||
if (cliSections[1] && cliSections[1].optionList) { | ||
if (cliSections[1] && cliSections[1].optionList && | ||
cliSections[1].optionList.every( | ||
(def) => def.name !== 'version' && def.alias !== 'v' | ||
) | ||
) { | ||
cliSections[1].optionList.push(versionInfo); | ||
@@ -56,3 +60,7 @@ } | ||
optionDefinitions.push(helpInfo); | ||
if (cliSections[1] && cliSections[1].optionList) { | ||
if (cliSections[1] && cliSections[1].optionList && | ||
cliSections[1].optionList.every( | ||
(def) => def.name !== 'help' && def.alias !== 'h' | ||
) | ||
) { | ||
cliSections[1].optionList.push(helpInfo); | ||
@@ -59,0 +67,0 @@ } |
11415
139
98