<commit_before>/**
 * Alloy
 * Copyright (c) 2012 by Appcelerator, Inc. All Rights Reserved.
 * See LICENSE for more information on licensing.
 */
 var program = require('commander'),
	logger = require("./common/logger"),
	U = require('./utils'),
	colors = require("colors"),
	_ = require("./lib/alloy/underscore")._,
	pkginfo = require('pkginfo'),
	path = require('path'),
	fs = require('fs'),
	CONST = require('./common/constants');

// patch to remove the warning in node >=0.8
path.existsSync = fs.existsSync || path.existsSync;

// setup our module so have the pkginfo version from package.json
pkginfo(module,'name','version');

////////////////////////////////////
////////// MAIN EXECUTION //////////
////////////////////////////////////

// Process command line input
program
	.version(module.exports.version, '-v, --version')
	.description('Alloy command line')
	.usage('COMMAND [ARGS] [OPTIONS]')
	.option('-a, --allStackTrace', 'No limit to the size of stack traces')
	.option('-b, --noBanner', 'Disable the banner')
	.option('-c, --config <config>','Pass in compiler configuration')
	.option('-f, --force','Force the command to execute')
	.option('-l, --logLevel <logLevel>', 'Log level (default: 3 [DEBUG])')
	.option('-n, --no-colors','Turn off colors')
	.option('-o, --outputPath <outputPath>', 'Output path for generated code')
	.option('-p, --project-dir <project-dir>', 'Titanium project directory')
	.option('-q, --platform <platform>', 'Target mobile platform [android,ios,mobileweb]')
	.option('-x, --column <column>', 'Column for source map query', 1)
	.option('-y, --line <line>', 'Line for source map query', 1)
	.option('-z, --source <source>', 'Source original file for source map query');

program.command('new'.blue+' <dir>'.white)
		.description('    create a new alloy project'.grey);

program.command('compile'.blue+' [dir]'.white)
		.description('compile into titanium sourcecode'.grey);

program.command('generate'.blue+' <type> <name>'.white)
		.description('    generate a new alloy type such as a controller'.grey);

program.parse(process.argv);
	

// Setup up logging output
//if (program.allStackTrace) { Error.stackTraceLimit = Infinity; }
Error.stackTraceLimit = Infinity;
logger.stripColors = program['colors'] === false;
logger.logLevel = program['logLevel'] || logger.TRACE;

if (!program.noBanner && program.args[0] !== 'info') {
	banner();
}

if (program.args.length === 0)
{
	var help = program.helpInformation();
	help = help.replace('Usage: alloy COMMAND [ARGS] [OPTIONS]','Usage: '+'alloy'.blue+' COMMAND'.white+' [ARGS] [OPTIONS]'.grey);
	help = logger.stripColors ? colors.stripColors(help) : help;
	console.log(help);
	process.exit(0);<commit_msg>adding future alloy test options<commit_after>/**
 * Alloy
 * Copyright (c) 2012 by Appcelerator, Inc. All Rights Reserved.
 * See LICENSE for more information on licensing.
 */
 var program = require('commander'),
	logger = require("./common/logger"),
	U = require('./utils'),
	colors = require("colors"),
	_ = require("./lib/alloy/underscore")._,
	pkginfo = require('pkginfo'),
	path = require('path'),
	fs = require('fs'),
	CONST = require('./common/constants');

// patch to remove the warning in node >=0.8
path.existsSync = fs.existsSync || path.existsSync;

// setup our module so have the pkginfo version from package.json
pkginfo(module,'name','version');

////////////////////////////////////
////////// MAIN EXECUTION //////////
////////////////////////////////////

// Process command line input
program
	.version(module.exports.version, '-v, --version')
	.description('Alloy command line')
	.usage('COMMAND [ARGS] [OPTIONS]')
	.option('-a, --app <app>', 'Test app folder for running "alloy test"')
	.option('-b, --noBanner', 'Disable the banner')
	.option('-c, --config <config>','Pass in compiler configuration')
	.option('-f, --force','Force the command to execute')
	.option('-l, --logLevel <logLevel>', 'Log level (default: 3 [DEBUG])')
	.option('-n, --no-colors','Turn off colors')
	.option('-o, --outputPath <outputPath>', 'Output path for generated code')
	.option('-p, --project-dir <project-dir>', 'Titanium project directory')
	.option('-q, --platform <platform>', 'Target mobile platform [android,ios,mobileweb]')
	.option('-s, --spec <spec>', 'test spec to use with "alloy test"')
	.option('-x, --column <column>', 'Column for source map query', 1)
	.option('-y, --line <line>', 'Line for source map query', 1)
	.option('-z, --source <source>', 'Source original file for source map query');

program.command('new'.blue+' <dir>'.white)
		.description('    create a new alloy project'.grey);

program.command('compile'.blue+' [dir]'.white)
		.description('compile into titanium sourcecode'.grey);

program.command('generate'.blue+' <type> <name>'.white)
		.description('    generate a new alloy type such as a controller'.grey);

program.parse(process.argv);
	

// Setup up logging output
Error.stackTraceLimit = Infinity;
logger.stripColors = program['colors'] === false;
logger.logLevel = program['logLevel'] || logger.TRACE;

if (!program.noBanner && program.args[0] !== 'info') {
	banner();
}

if (program.args.length === 0)
{
	var help = program.helpInformation();
	help = help.replace('Usage: alloy COMMAND [ARGS] [OPTIONS]','Usage: '+'alloy'.blue+' COMMAND'.white+' [ARGS] [OPTIONS]'.grey);
	help = logger.stripColors ? colors.stripColors(help) : help;
	console.log(help);
	process.exit(0);
{'fraction_non_alphanumeric': 0.21660516605166052, 'fraction_numerical': 0.004428044280442804, 'mean_word_length': 3.853178155774396, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '565958', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1668, 'n_words': 475}