提交 84a78d5b 编写于 作者: D Dimitri BAELI 提交者: Kohsuke Kawaguchi

[FIXED JENKINS-9789] display the list of available CLI Commands

上级 8af3905a
......@@ -59,6 +59,9 @@ Upcoming changes</a>
Output correct version from java -jar jenkins.war --version (broken since 1.410)
<li class=bug>
Correct usage text from java -jar jenkins.war --help
<li class=rfe>
CLI command page now lists all the available commands
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9789">issue 9789</a>)
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -24,6 +24,7 @@
*/
package hudson;
import hudson.cli.CLICommand;
import hudson.console.ConsoleAnnotationDescriptor;
import hudson.console.ConsoleAnnotatorFactory;
import hudson.model.AbstractProject;
......@@ -1377,4 +1378,15 @@ public class Functions {
public static Object rawHtml(Object o) {
return o==null ? null : new RawHtmlArgument(o);
}
public static ArrayList<CLICommand> getCLICommands() {
ArrayList<CLICommand> all = new ArrayList<CLICommand>(CLICommand.all());
Collections.sort(all, new Comparator<CLICommand>() {
public int compare(CLICommand cliCommand, CLICommand cliCommand1) {
return cliCommand.getName().compareTo(cliCommand1.getName());
}
});
return all;
}
}
......@@ -37,6 +37,12 @@ THE SOFTWARE.
<pre style="color: white; background-color:black; padding:1em; font-weight: bold">java -jar <a
style="color: white"
href="jnlpJars/jenkins-cli.jar">jenkins-cli.jar</a> -s ${h.inferHudsonURL(request)} help</pre>
<h2>${%Available Commands}</h2>
<ul>
<j:forEach items="${h.getCLICommands()}" var="command">
<li><b>${command.getName()}</b>: ${command.getShortDescription()}</li>
</j:forEach>
</ul>
</l:main-panel>
</l:layout>
</j:jelly>
Jenkins\ CLI=Jenkins CLI
blurb=You can access various features in Jenkins through a command-line tool. See \
<a href="http://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI">the Wiki</a> for more details of this feature.\
To get started, download <a href="{0}/jnlpJars/jenkins-cli.jar">jenkins-cli.jar</a>, and run it as follows:
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册