Exemple #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))
}
Exemple #2
0
// 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))
}