Beispiel #1
0
func main() {
	config := io.GetConfig()
	target, username, password := getNetworkCredentialsFromConfig(config.Map)
	//target, username, password := "******", "brooklyn", "Sns4Hh9j7l"
	network := net.NewNetwork(target, username, password)
	cmdFactory := command_factory.NewFactory(network, config)
	cmdRunner := command_runner.NewRunner(cmdFactory)
	metaDatas := cmdFactory.CommandMetadatas()
	theApp := app.NewApp(filepath.Base(os.Args[0]), cmdRunner, metaDatas...)
	theApp.Run(os.Args)
}
Beispiel #2
0
func main() {
	config := io.GetConfig()
	target, username, password := getNetworkCredentialsFromConfig(config.Map)
	//target, username, password := "******", "brooklyn", "Sns4Hh9j7l"
	network := net.NewNetwork(target, username, password)
	cmdFactory := command_factory.NewFactory(network, config)

	args, scope := scope.ScopeArguments(os.Args)
	cmdRunner := command_runner.NewRunner(scope, cmdFactory)
	metaDatas := cmdFactory.CommandMetadatas()
	theApp := app.NewApp(filepath.Base(args[0]), cmdRunner, metaDatas...)
	if err := theApp.Run(args); nil != err {
		error_handler.ErrorExit(err)
	}
}