mirror of
https://github.com/flynx/argv.js.git
synced 2025-10-28 10:20:09 +00:00
a bit better sub-command title style...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
de92caa190
commit
c9f99d9ce0
12
argv.js
12
argv.js
@ -702,6 +702,8 @@ object.Constructor('Parser', {
|
||||
footer: 'Written by: $AUTHOR\nVersion: $VERSION / License: $LICENSE',
|
||||
|
||||
helpExtendedCommandHeader: 'Command: $COMMAND',
|
||||
// to disable set to false...
|
||||
helpExtendedCommandHeaderUnderline: '-',
|
||||
|
||||
// NOTE: this supports but does not requires the 'colors' module...
|
||||
// XXX should wrap long lines...
|
||||
@ -970,14 +972,18 @@ object.Constructor('Parser', {
|
||||
// doc...
|
||||
if(this[n] instanceof Parser
|
||||
&& this[n].doc !== false){
|
||||
var title
|
||||
this.print([
|
||||
'',
|
||||
'',
|
||||
(this.helpExtendedCommandHeader
|
||||
(title = (this.helpExtendedCommandHeader
|
||||
?? 'Command: $COMMAND')
|
||||
.replace(/\$COMMAND/g, n.slice(1)),
|
||||
.replace(/\$COMMAND/g, n.slice(1))),
|
||||
this.helpExtendedCommandHeaderUnderline ?
|
||||
title.replace(/./g, this.helpExtendedCommandHeaderUnderline)
|
||||
: [],
|
||||
'',
|
||||
].join('\n'))
|
||||
].flat().join('\n'))
|
||||
this.handle(n, ['-h=noFooter'], n.slice(1)) } }
|
||||
|
||||
// footer...
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-argv",
|
||||
"version": "2.16.8",
|
||||
"version": "2.16.9",
|
||||
"description": "simple argv parser",
|
||||
"main": "argv.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user