vapor/console-kit

a bug when use class Group

linqingmo opened this issue · 1 comments

When use group command, it will pass redundant argument to arguments.
For example:

final class BuildProject: Command {
	let id = "project"
	
	let signature: [Argument] = [
		Value(name: "projectname")
	]
	
	let console: ConsoleProtocol
	init(console: ConsoleProtocol) {
		self.console = console
	}
	
	func run(arguments: [String]) throws {
		guard let projectname = try value("projectname", from: arguments).string else {
			throw HVPackageError.general("no projectname")
		}
		_ = try console.backgroundExecute(program: "xcodebuild", arguments: ["-project", projectname])
	}
}
try terminal.run(executable: executable, commands: [
			Group(id: "build", commands: [
					BuildProject(console: terminal)
				], help: [
					
				])
		], arguments: Array(iterator), help: [
			
		])

use in commanline:
package build project projectName

but let projectname = try value("projectname", from: arguments).string will be project not projectName

closing this due to inactivity