mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
use ScmClientConfig instance
This commit is contained in:
@@ -191,6 +191,7 @@ public class App
|
|||||||
name = "--config",
|
name = "--config",
|
||||||
usage = "optionConfig",
|
usage = "optionConfig",
|
||||||
metaVar = "metaVar_config",
|
metaVar = "metaVar_config",
|
||||||
|
handler = ConfigOptionHandler.class,
|
||||||
aliases = { "-c" }
|
aliases = { "-c" }
|
||||||
)
|
)
|
||||||
private ServerConfig config;
|
private ServerConfig config;
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ public class ConfigOptionHandler extends OptionHandler<ServerConfig>
|
|||||||
Setter<? super ServerConfig> setter)
|
Setter<? super ServerConfig> setter)
|
||||||
{
|
{
|
||||||
super(parser, option, setter);
|
super(parser, option, setter);
|
||||||
loadClientConfig();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
@@ -80,7 +79,7 @@ public class ConfigOptionHandler extends OptionHandler<ServerConfig>
|
|||||||
public int parseArguments(Parameters parameters) throws CmdLineException
|
public int parseArguments(Parameters parameters) throws CmdLineException
|
||||||
{
|
{
|
||||||
String name = parameters.getParameter(0);
|
String name = parameters.getParameter(0);
|
||||||
ServerConfig config = clientConfig.getConfig(name);
|
ServerConfig config = ScmClientConfig.getInstance().getConfig(name);
|
||||||
|
|
||||||
setter.addValue(config);
|
setter.addValue(config);
|
||||||
|
|
||||||
@@ -100,22 +99,4 @@ public class ConfigOptionHandler extends OptionHandler<ServerConfig>
|
|||||||
{
|
{
|
||||||
return "metaVar_config";
|
return "metaVar_config";
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private void loadClientConfig()
|
|
||||||
{
|
|
||||||
|
|
||||||
// todo
|
|
||||||
clientConfig = new ScmClientConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private ScmClientConfig clientConfig;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,12 @@
|
|||||||
|
|
||||||
VAL = value
|
VAL = value
|
||||||
|
|
||||||
|
optionConfig = Configuration name
|
||||||
optionServerUrl = SCM-Manager URL
|
optionServerUrl = SCM-Manager URL
|
||||||
optionUsername = Username
|
optionUsername = Username
|
||||||
optionPassword = Password
|
optionPassword = Password
|
||||||
optionHelpText = Shows this help
|
optionHelpText = Shows this help
|
||||||
|
|
||||||
|
metaVar_config = configname
|
||||||
|
metaVar_arg = subcommand arguments
|
||||||
|
metaVar_command = subcommand
|
||||||
|
|||||||
Reference in New Issue
Block a user