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

Add option for a prompt on the CLI #518

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gussmith23
Copy link
Contributor

@gussmith23 gussmith23 commented Feb 4, 2025

I'm working on a project that interacts with egglog's CLI programmatically. Being able to detect when a command is done is useful. A prompt is a very easy way to detect when a command completes.

This trips the nits detector because of the use of print! -- can I get around that somehow?

@gussmith23 gussmith23 requested a review from a team as a code owner February 4, 2025 15:15
@gussmith23 gussmith23 requested review from FTRobbin and removed request for a team February 4, 2025 15:15
Copy link

codspeed-hq bot commented Feb 4, 2025

CodSpeed Performance Report

Merging #518 will not alter performance

Comparing gussmith23:gussmith23-prompt (d253ec6) with main (215714e)

Summary

✅ 10 untouched benchmarks

@yihozhang
Copy link
Collaborator

The interactive mode will print a (done) once every command is done (sorry for the poor documentation). Does that work for you?

@gussmith23
Copy link
Contributor Author

The interactive mode will print a (done) once every command is done (sorry for the poor documentation). Does that work for you?

Unfortunately no -- here's why. My interactive routine needs to be able to run multiple commands at once, and only have a single prompt/marker appear at the very end of all of the commands. Currently, I do this by writing a batch of commands to a file and then using (include <filepath>). Because include is just a single command at the top level, all of the commands in the file will run and a single prompt will be printed when they're all done. Based on my testing, interactive mode prints a (done) after each command, even if the commands were included. This is an issue, because if I don't know how many commands were in the included file, I don't know how many (done)s to look for. With the prompt, however, I always know to look for a single prompt at the very end.

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

Successfully merging this pull request may close these issues.

2 participants