-
1. Re: CLI scripts: blank lines and comments?
jaikiran Sep 2, 2013 12:34 AM (in response to bwallis42)I'll check with Alexey to see if this is supported and if not then whether he thinks this a feature we would like to have in WildFly.
-
2. Re: CLI scripts: blank lines and comments?
bwallis42 Sep 2, 2013 2:44 AM (in response to bwallis42)What I posted was not quite correct, I think I am misunderstanding batch commands.
Running
% bin/jboss-cli.sh --connect 'run-batch --file=../Hg-Harvey/harvey-all/modeshape.cli' Failed to create batch from /Users/bwallis/InfoMedix/Harvey/jboss-eap-6.1/../Hg-Harvey/harvey-all/modeshape.cli: '#' is not a valid operation name.
fails but if I run
% bin/jboss-cli.sh --connect --file=../Hg-Harvey/harvey-all/modeshape.cli
then the script runs as expected so it is the run-batch command that doesn't seem to accept comments. I've also noticed that you cannot have 'if' commands in a batch or split a command across multiple lines (with '\'s at the end of the lines) or have blank lines in the file.
What I am looking for is a way to execute a complicated script atomically (as batch mode does) but I want to comment and structure the script so that it is resilient and maintainable and also use if/then/else.
-
3. Re: CLI scripts: blank lines and comments?
sfcoy Sep 2, 2013 3:05 AM (in response to bwallis42)1 of 1 people found this helpfulThere's a sample CLI script at https://docs.jboss.org/author/display/AS71/CLI+Recipes#CLIRecipes-ScriptedConfiguration which worked OK the last time I tried it.
What version of JBossAS/WildFly are you using?
-
4. Re: CLI scripts: blank lines and comments?
bwallis42 Sep 2, 2013 3:31 AM (in response to sfcoy)Stephen Coy wrote:
There's a sample CLI script at https://docs.jboss.org/author/display/AS71/CLI+Recipes#CLIRecipes-ScriptedConfiguration which worked OK the last time I tried it.
What version of JBossAS/WildFly are you using?
I just tried a cut down version of demo.cli (including comments and blank lines) and it runs for me as well using --file=demo.cli but (after removing the batch and run-batch commands from demo.cli) it cannot be run using the "run-batch --file=demo.cli". I'm surprised that run-batch seems to expect a different (more limited) input format, ie: no if/then/else, comments or blank lines.
The main issue for me is the lack of if/then/else support in batch mode, I don't need to use 'run-batch --file' if it doesn't allow comments, I'll just use the command line '--file' option.
I'm running EAP 6.1.0.GA