package org.geoserver.shell;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.shell.core.CommandMarker;
import org.springframework.shell.core.annotation.CliCommand;
import org.springframework.shell.core.annotation.CliOption;
import org.springframework.stereotype.Component;

@Component
public class GeoserverCommands implements CommandMarker {

    @Autowired
    private Geoserver geoserver;

    @CliCommand(value = "geoserver set", help = "Set the url, user, and password for Geoserver.")
    public void set(
        @CliOption(key = {"","url"}, mandatory = true, help = "The url") String url,
        @CliOption(key = {"user"}, mandatory = false, help = "The url", unspecifiedDefaultValue = "admin") String user,
        @CliOption(key = {"password"}, mandatory = false, help = "The url", unspecifiedDefaultValue = "geoserver") String password
    ) {
        geoserver.setUrl(url);
        geoserver.setUser(user);
        geoserver.setPassword(password);
    }

    @CliCommand(value = "geoserver show", help = "Show the url, user, and password for Geoserver.")
    public String show() {
        return geoserver.getUrl() + " " + geoserver.getUser() + " " + geoserver.getPassword();
    }
}
@@ -23,16 +23,78 @@
 shell;%0A%0A
+import it.geosolutions.geoserver.rest.GeoServerRESTPublisher;%0A
 import o
@@ -639,18 +639,13 @@
 y = 
-%7B%22%22,
 %22url%22
-%7D
 , ma
@@ -659,16 +659,77 @@
  = true,
+ unspecifiedDefaultValue = %22http://localhost:8080/geoserver%22,
  help = 
@@ -780,16 +780,14 @@
 y = 
-%7B
 %22user%22
-%7D
 , ma
@@ -894,17 +894,16 @@
 n(key = 
-%7B
 %22passwor
@@ -904,17 +904,16 @@
 assword%22
-%7D
 , mandat
@@ -1345,10 +1345,600 @@
 );%0A    %7D
+%0A%0A    @CliCommand(value = %22geoserver reset%22, help = %22Reset Geoserver's configuration.%22)%0A    public boolean reset() %7B%0A        GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());%0A        return publisher.reset();%0A    %7D%0A%0A    @CliCommand(value = %22geoserver reload%22, help = %22Reload Geoserver's configuration.%22)%0A    public boolean reload() %7B%0A        GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(geoserver.getUrl(), geoserver.getUser(), geoserver.getPassword());%0A        return publisher.reload();%0A    %7D
 %0A%7D

Add reset and reload commands.