Permalink
Browse files

working on a init function

  • Loading branch information...
1 parent 2f2a55e commit 205a31cccd0a6e9854efbd7fb128fdbcacda63ca @3rd-Eden 3rd-Eden committed Apr 10, 2012
Showing with 32 additions and 0 deletions.
  1. +21 −0 bin/initialize.js
  2. +11 −0 bin/square
View
@@ -0,0 +1,21 @@
+"use strict";
+
+var fs = require('fs');
+
+module.exports = function initialize (program, square) {
+ console.log(' init: initialize an empty project with a new square file');
+ console.log(' please select one fo the templates below');
+ console.log();
+
+ var templates = [
+ 'basic - small basic square.json template'
+ , 'advanced - more advanced square.json file'
+ , 'complex - leverage the full power of square'
+ ];
+ program.choose(templates, function pickone (selected, item) {
+ process.stdin.destroy();
+
+ console.log('Congratulations! You selected: ' + selected);
+ console.log('But... this feature isnt implemented yet');
+ });
+};
View
@@ -74,6 +74,17 @@ program
.option('-f, --filename <file>', 'alternate filenames', filters.list)
.option('-p, --plugin <plugins>', 'which plugins should be included', filters.list);
+/**
+ * Adding some basic commands
+ */
+
+program
+ .command('init')
+ .description('initialize an empty project')
+ .action(function action () {
+ require('./initialize')(program, square);
+ });
+
/**
* Display addition help information.
*/

0 comments on commit 205a31c

Please sign in to comment.