Skip to content

Commit

Permalink
Added -t, --template flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Oct 20, 2010
1 parent c28f153 commit 90de792
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions bin/express
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ var sessions = false;

var cssEngine;

/**
* Template engine to utilize.
*/

var templateEngine = 'jade';

/**
* Usage documentation.
*/
Expand All @@ -40,10 +46,11 @@ var usage = ''
+ '\x1b[1mUsage\x1b[0m: express [options] [PATH]\n'
+ '\n'
+ '\x1b[1mOptions\x1b[0m:\n'
+ ' -s, --sessions Add session support\n'
+ ' -c, --css ENGINE Add stylesheet ENGINE support (less|sass). Defaults to plain css\n'
+ ' -v, --version Output framework version\n'
+ ' -h, --help Output help information\n'
+ ' -s, --sessions Add session support\n'
+ ' -t, --template ENGINE Add template ENGINE support (jade|ejs). Defaults to jade\n'
+ ' -c, --css ENGINE Add stylesheet ENGINE support (less|sass). Defaults to plain css\n'
+ ' -v, --version Output framework version\n'
+ ' -h, --help Output help information\n'
;

/**
Expand Down Expand Up @@ -92,7 +99,7 @@ var ejsLayout = [
var ejsIndex = [
'<h1><%= title %></h1>'
, '<p>Welcome to <%= title %></p>'
].join('\n');
].join('\n');

/**
* Default css template.
Expand Down Expand Up @@ -231,6 +238,12 @@ while (args.length) {
? (cssEngine = args.shift())
: abort('--css requires an argument');
break;
case '-t':
case '--template':
args.length
? (templateEngine = args.shift())
: abort('--template requires an argument');
break;
default:
path = arg;
}
Expand Down

0 comments on commit 90de792

Please sign in to comment.