/
Holixus
/
node-getopt
Обзор
Документация
Войти
/
Holixus
/
node-getopt
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/help.js
28 строк
866 B
Miao Jiang
New options definition.
04 ноя 2012, 10:20
04 ноя 2012, 10:20
feff146
Код
Авторство
О чём код?
// examples/help.js // Works with help Getopt = require('..'); getopt = new Getopt([ ['s' , '' , 'short option.'], ['' , 'long' , 'long option.'], ['S' , 'short-with-arg=ARG' , 'option with argument'], ['L' , 'long-with-arg=ARG' , 'long option with argument'], ['' , 'color[=COLOR]' , 'COLOR is optional'], ['m' , 'multi-with-arg=ARG+' , 'multiple option with argument'], ['' , 'no-comment'], ['h' , 'help' , 'display this help'] ]); // Use custom help template instead of default help // [[OPTIONS]] is the placeholder for options list getopt.setHelp( "Usage: node help.js [OPTION]\n" + "node-getopt help demo.\n" + "\n" + "[[OPTIONS]]\n" + "\n" + "Installation: npm install node-getopt\n" + "Respository: https://github.com/jiangmiao/node-getopt" ); getopt.showHelp();