[ 
https://issues.apache.org/jira/browse/SOLR-11946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16352028#comment-16352028
 ] 

Jason Gerlowski commented on SOLR-11946:
----------------------------------------

Attached is a patch that shows what this would look like on Linux.  The 
attached patch moves most arg-parsing logic to Java land, with some caveats:
- Haven't touched the "auth" tool yet.  That tool is a little more complicated 
and I needed a bit more time on it.
- The help text is currently generated from the commons-cli {{Option}} and 
{{CommandLine}} classes.  It doesn't look much like the current help text.  If 
this is something we want to preserve as close as possible, this will require a 
bit more work (but is totally do-able).
- No changes included for the Windows ({{bin/solr.cmd}}) script.

Would love any feedback or suggestions anyone has.  Otherwise, I plan to revise 
this patch and add Windows support in the coming days.

> Move bin/solr arg-parsing logic to Java
> ---------------------------------------
>
>                 Key: SOLR-11946
>                 URL: https://issues.apache.org/jira/browse/SOLR-11946
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: scripts and tools
>    Affects Versions: master (8.0)
>            Reporter: Jason Gerlowski
>            Priority: Minor
>             Fix For: master (8.0)
>
>         Attachments: SOLR-11946.patch
>
>
> Currently, there is logic in three different places that parses arguments for 
> the {{bin/solr}} scripts.  There is logic in the scripts themselves 
> ({{bin/solr}}, {{bin/solr.cmd}}), and there is logic in Java to parse the 
> arguments sent by the scripts themselves ({{SolrCLI.java}}.
> This creates maintenance burden. It makes it easy for inconsistencies to 
> creep into the scripts (see SOLR-11840).  It adds work when 
> adding/removing/modifying {{bin/solr}} script behavior.  And it forces anyone 
> hoping to improve the scripts to be conversant in both bash and Windows batch 
> scripting.
> It would be a big help if _all_ the argument parsing was done on the Java 
> side, and little or none was done in the scripts themselves.  There are a few 
> situations in which this is difficult, but in no cases is it impossible.
> We should move this logic into Java-land.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to