/
Holixus
/
node-getopt
Обзор
Документация
Войти
/
Holixus
/
node-getopt
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/oneline.js
16 строк
689 B
Miao Jiang
Support oneline parse.
04 ноя 2012, 16:02
04 ноя 2012, 16:02
0b69a77
Код
Авторство
О чём код?
// node-getopt oneline example. opt = require('..').create([ ['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'], ['v' , 'version' , 'show version'] ]) // create Getopt instance .bindHelp() // bind option 'help' to default action .parseSystem(); // parse command line console.info(opt);