[
https://issues.apache.org/jira/browse/LENS-676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14634656#comment-14634656
]
Rajat Khandelwal commented on LENS-676:
---------------------------------------
The way cli works is it launches
https://github.com/spring-projects/spring-shell/blob/master/src/main/java/org/springframework/shell/Bootstrap.java
as a main class. We are taking arguments in our lens-cli.sh, using the ones we
can use for the shell script(e.g. classpath, conf etc) and ignoring the rest.
With this change, the args not useful at the shell script level are passed to
Bootstrap as String[] args. Now bootstrap can accept bunch of arguments
described here:
https://github.com/spring-projects/spring-shell/blob/master/src/main/java/org/springframework/shell/SimpleShellCommandLineOptions.java#L51.
The most important functionality gained is the ability to run commands from a
command file. You can store all your commands in a file and launch lens cli
with --cmdfile path/to/cmdfile and the commands will be run for you before
exiting.
Mostly all shells have this functionality, especially the widely used *sh
family, sql shells, python shell, ruby shell etc.
Have tested with passing a file as cmdfile argument. CLI starts, runs the
commands and quits.
> pass cli's extra arguments to Bootstrap
> ---------------------------------------
>
> Key: LENS-676
> URL: https://issues.apache.org/jira/browse/LENS-676
> Project: Apache Lens
> Issue Type: Improvement
> Components: client
> Reporter: Rajat Khandelwal
> Assignee: Rajat Khandelwal
> Fix For: 2.3
>
> Attachments: LENS-676_2015-07-20_19:41:31.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)