Skip to content

Instantly share code, notes, and snippets.


Valeriu Paloş vpalos

View GitHub Profile
vpalos / options.js
Created May 20, 2011
JS: CLI argument parser.
View options.js
/** Command-line options parser (
Copyright 2011 Valeriu Paloş ( All rights reserved.
Released as Public Domain.
Expects the "schema" array with options definitions and produces the
"options" object and the "arguments" array, which will contain all
non-option arguments encountered (including the script name and such).
[«short», «long», «attributes», «brief», «callback»]