You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					42 lines
				
				688 B
			
		
		
			
		
	
	
					42 lines
				
				688 B
			| 
											3 years ago
										 | #!/usr/bin/env node
 | ||
|  | 'use strict'; | ||
|  | var argv = require('minimist')(process.argv.slice(2)); | ||
|  | var pkg = require('./package.json'); | ||
|  | var osxRelease = require('./'); | ||
|  | var input = argv._[0]; | ||
|  | 
 | ||
|  | function help() { | ||
|  | 	console.log([ | ||
|  | 		'', | ||
|  | 		'  ' + pkg.description, | ||
|  | 		'', | ||
|  | 		'  Usage', | ||
|  | 		'    osx-release [release]', | ||
|  | 		'', | ||
|  | 		'  Example', | ||
|  | 		'    osx-release', | ||
|  | 		'    Mavericks 10.9', | ||
|  | 		'', | ||
|  | 		'    osx-release 14.0.0', | ||
|  | 		'    Yosemite 10.10' | ||
|  | 	].join('\n')); | ||
|  | } | ||
|  | 
 | ||
|  | if (!input || argv.help) { | ||
|  | 	help(); | ||
|  | 	return; | ||
|  | } | ||
|  | 
 | ||
|  | if (argv.version) { | ||
|  | 	console.log(pkg.version); | ||
|  | 	return; | ||
|  | } | ||
|  | 
 | ||
|  | var output = osxRelease(input); | ||
|  | 
 | ||
|  | if (!output.name || !output.version) { | ||
|  | 	process.exit(1); | ||
|  | } | ||
|  | 
 | ||
|  | console.log(output.name + ' ' + output.version); |