function parseArgv (argv) {
	const names = argv._.slice(1)

	const nameVersionPairs = fromPairs(names.map((target) => {
		const nameVersion = /^(@?.+?)(?:@(.+)?)?$/.exec(target)
		return [nameVersion[1], nameVersion[2] || '*']
	}))

	const field = argv['save-dev'] ? 'devDependencies'
		: argv['save-optional'] ? 'optionalDependencies'
		: 'dependencies'

	return {[field]: nameVersionPairs}
}
parse the command line arguments and create the dependency field of a
`package.json` file from it.
@param  {Array} argv - command line arguments.
@return {NullPkgJSON} - package.json created from explicit dependencies
supplied via command line arguments.