New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse multiple commands without exiting the process #934
Labels
Milestone
Comments
Closed
I have started work on an exit override: #945 (comment) |
There are improvements on the develop branch for the next release (#1040). |
v4.0.0-0 prerelease published: #1067 |
v4.0.0 has been released. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Goals
-h
and-v
, and even on incorrect input)Edit:
Goals continuation:
-v
and-h
into a string instead of into the terminalUse case
A bot which should listen for new messages in a live-chat channel.
Upon the arrival of a new message, it will look for a specific prefix, then send the command to commander.js to be parsed, and will take action accordingly.
Notice: The bot itself runs on a server in an automated manner and doesn't need nor expect any command-line arguments. The goal here is to parse several commands without the node process exiting because commander.js feels like it.
When a
prefix -v
comes along, it should respond. And it does - great!But now my bot has made a
clean exit
.Turns out commander.js decides when my app is done executing.
This behaviour is, of course, unacceptable, as the next user typing
prefix -v
into the chat will wait forever, for the bot is now shut down.The fact that the bot needs to be reconnected to the chat-API and a database every time it starts doesn't make this situation easier.
TL;DR
How does one parse multiple commands without having their app shut down in between?
How to get the output from
-v
and-h
into a string instead of into the terminal?PS: #443 Talks about something somewhat-related
The text was updated successfully, but these errors were encountered: