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 :resetblocks / :rb to REPL #920

Merged
merged 1 commit into from
Feb 4, 2022
Merged

Conversation

johnkerl
Copy link
Owner

@johnkerl johnkerl commented Feb 4, 2022

This is for #918

$ rlwrap mlr repl
Miller 6.0.0-dev REPL for darwin/amd64/go1.17
Docs: https://miller.readthedocs.io
Type ':h' or ':help' for online help; ':q' or ':quit' to quit.

[mlr] :h repl-list
:l or :load
:o or :open
:reopen
:r or :read
:w or :write
:rw
:c or :context
:s or :skip
:p or :process
:w or :>
:w or :>>
:b or :begin
:m or :main
:e or :end
:astprint
:blocks
:rb or :resetblocks
:q or :quit
:h or :help

[mlr] :h :rb
:rb
:resetblocks with no arguments.
Clears out all begin, main, and end blocks that have been loaded.

[mlr] :blocks
#begin 0
#main  0
#end   0

[mlr] begin { print "Hello" }
[mlr] end { print "world!" }
[mlr] :b
Hello
[mlr] :e
world!
[mlr] :blocks
#begin 1
#main  0
#end   1

[mlr] :rb

[mlr] :b
[mlr] :e
[mlr] :blocks
#begin 0
#main  0
#end   0
[mlr]

@johnkerl johnkerl merged commit aa96004 into main Feb 4, 2022
@johnkerl johnkerl deleted the issue-918-repl-reset-blocks branch February 4, 2022 14:53
@vapniks
Copy link
Contributor

vapniks commented Feb 6, 2022

Would be nice if you could also reset begin, main & end blocks independently, e.g. by passing an arg to :rb

@johnkerl
Copy link
Owner Author

johnkerl commented Feb 6, 2022

@vapniks was thinking same, glad to hear demand for it :D

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