Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/index.js b/index.js
- index 11b46ac..4cf1473 100644
- --- a/index.js
- +++ b/index.js
- @@ -1,6 +1,7 @@
- #!/usr/bin/env node
- const cli = require('cac')('txtl')
- +var readline = require('readline')
- const { log } = console
- @@ -8,6 +9,19 @@ const { log } = console
- cli.command('', 'Starts an interactive chat session in a thread.')
- .action((opts) => {
- log('do something')
- + // Specify our readline interface
- + const rl = readline.createInterface({
- + input: process.stdin,
- + output: process.stdout,
- + terminal: false
- + })
- + // Run callback for each input on stdin
- + rl.on('line', (line) => {
- + if (line !== '') {
- + log(line)
- + rl.prompt()
- + }
- + })
- })
- .option('--thread [thread]', 'Thread ID. Omit to use the \'default\' thread.', {
- default: 'default',
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement