-
Notifications
You must be signed in to change notification settings - Fork 159
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
Support a unique directive to pass JBang CLI options #1808
Comments
But which options would you like to pass? I think most (of the useful) options you can pass are already available as //-tags. Are we missing some? Hmmm what I do see is perhaps a lack of documentation... @maxandersen do we really have no list of supported //-tags in our docs?? I'm trying to find it but it's because I still haven't had any coffee and I keep missing it or it's because it doesn't exist. Edit: and the section on java agents mentions the CLI option |
Oh, could you explain how I can use
If I read the doc correctly, I don't think |
Hmm, it doesn't look like ///usr/bin/env jbang "$0" "$@" ; exit $?
//--quiet
// //DEPS <dependency1> <dependency2>
import static java.lang.System.*;
public class hello {
public static void main(String... args) {
out.println("Hello World");
}
} still outputs like below when executing:
neither |
Having a jbang options inside the source files is problematic for several reasons:
so that is not a viable solution. The prefix header is the right place to have it or if you really must (i.e. for windows) create an alias/batch command that does the call like for any other CLI. |
@maxandersen Thanks. I understand your point. But as Tako suggested, there are already some tags that are supported, e.g. It seems a bit inconsistent to me:
In this issue, among these, what I'd like to use most is
|
Is your feature request related to a problem? Please describe.
After further reflection on the issue #1803, now I think that it'd be great if JBang provides another directive
//JBANG_OPTIONS <jbang_options>
, which is similar to//JAVAC_OPTIONS
or//JAVA_OPTIONS
but solely for the JBang CLI options https://www.jbang.dev/documentation/guide/latest/cli/jbang-run.html#_options.After #1803, I think it's not a good design to only allow users to pass JBang options in the first line of a script, considering the possible bad effects by misconfigurations (see #1803 for more details):
///usr/bin/env jbang <options> "$0" "$@" ; exit $?
Describe the solution you'd like
Support a new directive
//JBANG_OPTIONS
:This way, any misconfigurations in the
//JBANG_OPTIONS
line would never result in the naughty infinite loops.Describe alternatives you've considered
It can be a different name like
//JBANG_PARAMETERS
or//JBANG_CLI_OPTIONS
. Or, can any of the existing directives already serve the exact purpose?Additional context
The original issue:
The text was updated successfully, but these errors were encountered: