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

Possibility to use shell commands #57

Open
efferto opened this issue Oct 9, 2019 · 2 comments
Open

Possibility to use shell commands #57

efferto opened this issue Oct 9, 2019 · 2 comments

Comments

@efferto
Copy link

efferto commented Oct 9, 2019

Hello,

I'm using replxx for an interactive command line application combined with TCLAP. It is nice and easy to use. I was wondering if there is a way to support also system commands.
For example on linux if I type ls (dir on windows), send it to the system prompt and get the output back.
Do you think there is an easy way? I mean, if the command is not one of the supported (auto-completed) send it to the system?

Thanks a lot.

@efferto efferto changed the title Possibility to use system commands Possibility to use shell commands Oct 10, 2019
@AmokHuginnsson
Copy link
Owner

Hello.

If I understood your question correctly, you are asking for using replxx to implement
an interactive system shell for the command line.

It can be achieved, in fact there is already a project that does precisely that: Huginn - a new interactive system shell for both Linux/Unix and Windows systems (Github mirror).
In this project you can see how replxx can be utilized to implement so called "interactive part" of system shell and how much more work is necessary to have fully functioning shell.

If you asked for something simpler than implementing fully fledged system shell
so that replxx would do most of the job for you by some method for running system commands
and "forwarding" their I/O then unfortunately this would be out of scope for the replxx project.

It is worth mentioning that Linux' ls is implemented completely different than Windows' dir
in a sense that ls exists in the system as a standalone program that can be executed by any other process directly while dir on Windows is a cmd's built-in and can be executed only from cmd context.

I hope this answer your question.

@AmokHuginnsson AmokHuginnsson pinned this issue Dec 26, 2019
@efferto
Copy link
Author

efferto commented Jan 9, 2020

@AmokHuginnsson Thanks for your reply. This is exactly what I had in mind. I'll have a look into the huginn project.

Repository owner deleted a comment from alexey-milovidov Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants