You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by "Xavier Hanin (JIRA)" <ji...@apache.org> on 2007/04/25 20:55:15 UTC

[jira] Resolved: (IVY-480) Allow "main" parameters to be passed directly (instead of using -args flag)

     [ https://issues.apache.org/jira/browse/IVY-480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xavier Hanin resolved IVY-480.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0

I've applied your patch (with a minor fix on arraycopy), it will now be possible to proceed as you suggested. I don't think that deprecating -args is really necessary though, so there won't be a deprecation message when used.

> Allow "main" parameters to be passed directly (instead of using -args flag)
> ---------------------------------------------------------------------------
>
>                 Key: IVY-480
>                 URL: https://issues.apache.org/jira/browse/IVY-480
>             Project: Ivy
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.4.1
>            Reporter: Archie Cobbs
>             Fix For: 2.0
>
>         Attachments: argspatch.txt
>
>
> When running ivy in standalone mode using the {{-main}} flag, any extra parameters passed on the command line (i.e., not as flag arguments) are simply ignored.
> E.g., if I invoke {{java fr.jayasoft.ivy.Main -main com.exmaple.Main foo bar}} the {{foo bar}} parameters are ignored. To pass "foo" and "bar" to my main method, I have to use {{-args foo}} and {{-args bar}}.
> Suggestion: when using the {{-main}} flag, allow the parameters to the main method to be passed directly on the command line as "extra" parameters, as an alternative to using the {{-args}} flag.
> The motivation for this is that this would be much easier to deal with in shell scripts. E.g. suppose I want to write a shell script {{/usr/bin/foo}} which uses ivy to resolve dependencies and execute some main class {{com.example.foo.Main}}. To do this I'd have to parse the command line into individual arguments, then precatenate each one with a {{-args}} flag, etc. This sounds hard enough, but when you consider that some parameters may be quoted, it becomes nearly impossible. With the change suggested here, it would become trivial: I'd just do something like {{ivy -ivy /usr/share/foo.ivy -main com.example.foo.Main ${1+"$@"} }} in the shell script.
> If this is implemented, it should probably become the recommended approach, and {{-args}} be deprecated.
> As a side note, the {{-args}} flag is mis-named: it should be called {{-arg}} instead (but I'd prefer to have it just be deprecated).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.