How to use get-cli-arg - 1 common examples

To help you get started, we’ve selected a few get-cli-arg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bevry / boundation / source / answers.js View on Github external
question.when = async function(answers) {
				let reason,
					result,
					opaque = false

				// fetch values
				const value = await Promise.resolve(
					fetch(question, question.default, answers)
				)
				const values = Object.assign({ [name]: value }, defaults, answers)

				// check args
				const args = arg ? [name, arg] : [name]
				for (const _arg of args) {
					const _value = getarg(process.argv, _arg)
					if (_value != null) {
						opaque = true
						defaults[name] = _value === 0.1 ? '0.10' : _value
						reason = 'arg'
					}
				}

				// check user
				if (user && !reason && user[name] != null) {
					defaults[name] = user[name]
					reason = 'package'
				}

				// fallback to other checks if no arg
				if (!reason) {
					// check when and ignore

get-cli-arg

Get the value of a CLI argument

Artistic-2.0
Latest version published 11 months ago

Package Health Score

63 / 100
Full package analysis

Popular get-cli-arg functions