punkave/boring

Name: boring

Owner: P'unk Avenue

Description: A minimalist command line option parser.

Created: 2015-04-11 15:37:51.0

Updated: 2015-12-09 11:58:55.0

Pushed: 2015-04-11 15:40:48.0

Homepage: null

Size: 104

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

boring

A command line argument parser without pirates

what you get

When someone types:

 app jump sideways --foo --bar=whee --super-cool=totally

You get:


 [ "jump", "sideways"],
o: true,
r: "whee",
uper-cool": "totally"

Notice that parameters without --, if any, go into the _ array. Parameters with -- become properties in their own right.

How you get it
argv = require('boring')();
What you don't get
Single hyphens: nope

There is no support for old-fashioned “single-hyphen” options, like:

0

Or:


You can't tell which are boolean and which take arguments unless a specification is passed in. And that's not boring enough for me.

Usage messages, strictness, etc.: nope

These are very simple to implement, and if you're like me, you'd rather do it yourself.

Philosophy

I have nothing against full-featured, pirate-themed option parsers, which are very nice if you're into that sort of thing. I just find myself walking the plank when my options don't follow the pattern of what's easy to validate with piracy.

This simple module is too dumb to break.

About P'unk Avenue and Apostrophe

boring was created at P'unk Avenue for use in Apostrophe, an open-source content management system built on node.js. If you like boring you should definitely check out apostrophenow.org. Also be sure to visit us on github.

Support

Feel free to open issues on github.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.