Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var prompt = require('cli-prompt');
- cli = prompt({
- infinite: false,
- format: 'pryjs> '
- })
- cli.on('value', function(input) {
- if (input[0] === 'close') {
- console.log('closing..', input);
- cli.close();
- var ps = prompt({
- prompt: 'blaine'
- });
- follower = null;
- ps.multiline({prompt: {format: '----> '}, key: function(input) {
- if (input === '\r' && follower === input) {
- return true;
- }
- follower = input;
- return false;
- }}, function(err, lines, raw) {
- console.log('value', raw);
- ps.close();
- cli = prompt({
- infinite: false,
- format: 'pryjs> '
- })
- cli.on('value', function(input) {
- if (input[0] === 'close') {
- console.log('closing..', input);
- cli.close();
- // finisheddddddd
- } else {
- console.log('opening..', input);
- cli.run();
- }
- });
- cli.run();
- });
- } else {
- console.log('opening..', input);
- cli.run();
- }
- });
- cli.run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement