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

minor REPL enhancements #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michaelficarra
Copy link
Contributor

Full list of changes in line number order:

do_exit if line.nil?
puts line unless $stdin.tty?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the intention here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see from your comment you want output when it's used in a pipe. I personally think this should be off by default, but it's a nice command-line option. For Postgres' psql it's the "-a" option, for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a nice REPL feature. I don't see why a flag would be useful, though. Is there a reason someone wouldn't want the output?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if you're writing a pipe it's not necessarily nice to have things in the middle dumping stuff to stdout. As another example, there's tar -v. I'm old (from when cp was braindead) so I often run things like "tar cf - . | (cd /foo/bar; tar xf -)". I definitely don't want both of the tar calls to dump the file list, and in many cases I don't want either one to do so. But I agree that it's a useful flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But who's using REPL output as the input to a pipe? Again, I don't think there's a use case that would prefer the input not to be echoed, so no need for a flag. At least not one that's off by default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me that you always (or usually) want to see rebl input lines on stdout any more than you'd want to see inbound network messages on stdout. If your goal is to control bud from a command line script and see what it does, it's not clear whether you want that control logic in the output.

Anyway, I'm very open to a command-line flag on this; we can ponder what the right default is but the important thing is to enable what you're asking for here.

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.

Ctrl+C from REBL messes up shell; Ctrl+D works fine
2 participants