Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/node-red/node_modules/args/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict'
module.exports = function() {
const name = this.config.name || this.binary.replace('-', ' ')
const firstBig = word => word.charAt(0).toUpperCase() + word.substr(1)
const parts = []
const groups = {
commands: true,
options: true,
examples: true
}
for (const group in groups) {
if (this.details[group].length > 0) {
continue
}
groups[group] = false
}
const optionHandle = groups.options ? '[options] ' : ''
const cmdHandle = groups.commands ? '[command]' : ''
const value =
typeof this.config.value === 'string' ? ' ' + this.config.value : ''
parts.push([
` Usage: ${this.printMainColor(name)} ${this.printSubColor(
optionHandle + cmdHandle + value
)}`,
''
])
for (const group in groups) {
if (!groups[group]) {
continue
}
parts.push(['', firstBig(group) + ':', ''])
if (group === 'examples') {
parts.push(this.generateExamples())
} else {
parts.push(this.generateDetails(group))
}
parts.push(['', ''])
}
let output = ''
// And finally, merge and output them
for (const part of parts) {
output += part.join('\n ')
}
if (!groups.commands && !groups.options) {
output = 'No sub commands or options available'
}
const { usageFilter } = this.config
// If filter is available, pass usage information through
if (typeof usageFilter === 'function') {
output = usageFilter(output) || output
}
console.log(output)
if (this.config.exit && this.config.exit.help) {
// eslint-disable-next-line unicorn/no-process-exit
process.exit()
}
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0268 ]-- |