示例#1
0
// Execute runs this command
func (s *SpecFile) Execute(args []string) error {
	input, err := loadSpec(string(s.Input))
	if err != nil {
		return err
	}

	swspec, err := scan.Application(s.BasePath, input, nil, nil)
	if err != nil {
		return err
	}

	return writeToFile(swspec, string(s.Output))
}
示例#2
0
文件: spec.go 项目: vmware/vic
// Execute runs this command
func (s *SpecFile) Execute(args []string) error {
	input, err := loadSpec(string(s.Input))
	if err != nil {
		return err
	}

	var opts scan.Opts
	opts.BasePath = s.BasePath
	opts.Input = input
	opts.ScanModels = s.ScanModels
	swspec, err := scan.Application(opts)
	if err != nil {
		return err
	}

	return writeToFile(swspec, string(s.Output))
}