Skip to content
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

[Question] How to manually print help and errors ? #1842

Closed
KaKi87 opened this issue Jan 13, 2023 · 5 comments
Closed

[Question] How to manually print help and errors ? #1842

KaKi87 opened this issue Jan 13, 2023 · 5 comments

Comments

@KaKi87
Copy link

KaKi87 commented Jan 13, 2023

Hello,

I'm using commander to serve a REPL through SSH using ssh2.

Using action, I can manually print the output of my command using the proper way for the user to receive it.

But when the user types help or an invalid input, the output gets printed in the server's console.

How can I prevent that, get the output and print it myself ?

Thanks

@shadowspawn
Copy link
Collaborator

See .configureOutput(). (It was added to allow custom processing for this sort of situation.)

@KaKi87
Copy link
Author

KaKi87 commented Jan 13, 2023

This is awesome. Thanks

@KaKi87 KaKi87 closed this as completed Jan 13, 2023
@shadowspawn
Copy link
Collaborator

For interest, early PR and discussion that led to configureOutput in #1371

@KaKi87
Copy link
Author

KaKi87 commented Jan 13, 2023

Honestly, when realizing how much default behavior the lib has, I was afraid that I would at some point hit an issue due to said defaults, which could have been replied with 'wontfix', thus forcing me to find yet another library to use.

But, I'm really really glad this wasn't the case, so much kudos to you.

@KaKi87
Copy link
Author

KaKi87 commented Jan 13, 2023

Also for interest, I'm creating the CLI version of my SSHception project, which is originally a TUI, but not practical on mobile devices and small screens.

Screenshot from 2023-01-13 04-38-21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants