-
Notifications
You must be signed in to change notification settings - Fork 26
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
os.args() and passthru from CLI #102
Conversation
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.
This is looking good. Just left a couple minor questions/comments.
updated. see what you think |
@edhemphill - this all looks good. Just this one little update to do: After that I think this is good to go. I'll give it a try just to sanity check. |
Co-authored-by: Curtis Myzie <curtis.myzie@gmail.com>
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.
good catch
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.
This looks good to me.
go run ./cmd/risor -c "os.args()" -- -foo --bar baz
[
"-foo",
"--bar",
"baz"
]
One thing we should look at as a follow-up is what the shebang line should be now. What I had in there before doesn't seem to work, but I don't think that needs to hold up this PR.
Not working:
#!/usr/bin/env risor --
os.args()
yeah - i see what you're saying... will try to fix. It's not executing the script. |
so in my testing this works: test.tm:
As well as some other variations with and without With the above, you can pass args to the risor script like:
To get around having to pass args behind a risor.sh:
test.tm:
|
i'll try to update this PR with some tests.