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

Repl enhancements #417

Open
5 tasks
lzrd opened this issue Sep 5, 2023 · 2 comments
Open
5 tasks

Repl enhancements #417

lzrd opened this issue Sep 5, 2023 · 2 comments
Assignees
Labels
🌟 enhancement New feature or request.

Comments

@lzrd
Copy link
Contributor

lzrd commented Sep 5, 2023

It would be useful if the repl could be used in scripting and/or provided scripting.

  • Input from stdin (not just /dev/tty) should be accepted
  • Comments and blank lines should be ignored
  • All commands should respect the -j flag for JSON or other parser friendly output format.
  • Ensure that humility commands' success/failure status can be parsed.
  • Doing more than the above quickly gets to the point of embedding an interpreter, evaluate that effort and decide what to do.

This should work but doesn't because reedline forces input to come from /dev/tty and not stdin.

egrep -v '(^#|^$)' <<! | humility ...
# Get task status:
tasks

# Comments and blank lines should be ignored without filtering input.
!
@steveklabnik steveklabnik added the 🌟 enhancement New feature or request. label Sep 5, 2023
@steveklabnik steveklabnik self-assigned this Sep 5, 2023
@steveklabnik
Copy link
Contributor

Re the reedline bug: nushell/reedline#509

@jclulow
Copy link
Contributor

jclulow commented Sep 5, 2023

It would be pretty neat to be able to pass a rhai program to humility that was able to run commands, inspect their output, make decisions, cause the humility process to exit with a non-zero status code, etc. I suspect we could use that in manufacturing for things that we, today, perform with bash scripts that chain multiple humility invocations, etc. It could also be useful in a future series of automated dump classifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

3 participants