-
Notifications
You must be signed in to change notification settings - Fork 15
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
Is it possible to provide arguments (args) to a script? #13
Comments
The -Dname=value method is the intended way of passing command-line
arguments. You access them in your script as though they were config
parameters. You don't need a .conf file, but if you did have one, you
actually could supply defaults in the .conf and then simply override them
on the command-line.
The main reason I never added true command-line arguments is that you can
technically ask blaze to run multiple tasks at a time -- e.g. "blaze a b c"
where a, b, and c are all separate tasks. You'd then require some
convoluted strategy of "blaze a [args for a] b [args for b] c [args for c]"
kind of syntax. Thus, I actually thought the config -Dname=value strategy
for passing values is somewhat superior in a way.
…On Tue, Apr 3, 2018 at 4:34 PM, Tobse ***@***.***> wrote:
Can I provide arguments which blaze passes to the script? So it would be
possible to write:
fun main(args: Array<String>) {
print(args)
}
and call java -jar blaze.jar -args mySuperArgument ?
I saw the blaze.conf
<https://github.com/fizzed/blaze/blob/master/docs/CONFIG.md> property
option. But in this way I have to add a blaze dependency / import to my
script, which I want to avoid. And it's not flexible enough like arguments.
Or is the java -Dname=value the only possibility to pass an argument to a
script? Which is not typical if i run the script without blaze, or want to
test it with JUnit.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#13>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjwAmW0_dsT2pGr1JmCoZew10KYHxSOks5tk9zOgaJpZM4TFvhi>
.
|
Thanks for the fast reply. Your idea with the config strategy sounds reasonable, and of course works pretty well in my case. To make it easier to migrate existing scripts something like a |
It'd be fairly straight forward to convert "-a arg" to simply by an alias
to "-Da=arg" in the java boostrap code. I'd be supportive of a PR that
implemented that kind of feature.
…On Tue, Apr 3, 2018 at 5:45 PM, Tobse ***@***.***> wrote:
Thanks for the fast reply. Your idea with the config strategy sounds
reasonable, and of course works pretty well in my case. To make it easier
to migrate existing scripts something like a -a|--args options could help.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAjwAggfT0t48AjkcR5sssanBh_S5SLjks5tk-2SgaJpZM4TFvhi>
.
|
Cleaning up old issues. This was addressed in recent blaze versions where "--argument" is now supported. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can I provide arguments which blaze passes to the script? So it would be possible to write:
and call
java -jar blaze.jar -args mySuperArgument
?I saw the blaze.conf property option. But in this way I have to add a blaze dependency / import to my script, which I want to avoid. And it's not flexible enough like arguments.
Or is the java
-Dname=value
the only possibility to pass an argument to a script? Which is not typical if i run the script without blaze, or want to test it with JUnit.The text was updated successfully, but these errors were encountered: