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
implement 'source' builtin command #18
Conversation
Hi @ngklingler, Thanks for the PR. The But reloading refile is a useful feature. We can merge this PR with the following adjust:
|
Hey @mitnk Good call on those points. I changed the source commmand to check that the specified file ends in "cicadarc" if it does, we load the file; if it doesn't then it throws an error that only loading from cicadarc files is supported and scripting is a WIP. I added the source command to the completer, and I updated the changelog to mark this change. Let me know if anything else should be done. |
} | ||
if !args[1].ends_with("cicadarc") { | ||
println_stderr!("cicada: source command only supports cicadarc files"); | ||
println_stderr!("scripting in cicada is still a work in progress"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we should have a return 1;
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 23ec537
Wouldn't be coding if I didn't introduce an error :)
Looks great! Thanks again! |
Hey,
I noticed your shell does not have the
source
command as one of its builtins, which lets you source rc files during a session. It works like this: make a change to ~/.cicadarc, runsource ~/.cicadarc
, and any changes you made to your RC file will then be loaded. I was a pretty simple implementation, I just had to call theload_file
function in the rcfile module. I hope you will incorporate this into your project.