Skip to content
Myr

docs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 4988dd8 · Browse files · 2 files+23 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+23 added−3 removed

  • other:+23 added−3 removed

2 files+23 added−3 removed

modified:examples/confirm-3 removed
4 unmodified lines
5 */67var program = require('../');89program10 .parse(process.argv);119program.confirm('continue? ', function(ok){10 console.log(' got %j', ok);11 process.stdin.destroy();12});
modified:lib/commander.js+23 added
669 unmodified lines
670671/**672 * Prompt `str` and callback `fn(val)`673 *674 * Commander supports single-line and multi-line prompts.675 * To issue a single-line prompt simply add white-space676 * to the end of `str`, something like "name: ", whereas677 * for a multi-line prompt omit this "description:".678 *679 *680 * Examples:681 *682 * program.prompt('Username: ', function(name){683 * console.log('hi %s', name);684 * });685 *686 * program.prompt('Description:', function(desc){687 * console.log('description was "%s"', desc.trim());688 * });689 *690 * @param {String} str691 * @param {Function} fn692 * @api public693 */
5 unmodified lines
699700/**701 * Confirmation prompt with `str` and callback `fn(bool)`702 *703 * Examples:704 *705 * program.confirm('continue? ', function(ok){706 * console.log(' got %j', ok);707 * process.stdin.destroy();708 * });709 *710 * @param {String} str711 * @param {Function} fn712 * @api public713 */
62 unmodified lines