@@ -76,6 +76,8 @@ extension Group {
7676 addCommand ( name, AnonymousCommand { parser in closure ( ) } )
7777 }
7878
79+ // MARK: Argument Commands
80+
7981 /// Add a command which takes one argument using a closure
8082 public func command< A: ArgumentConvertible > ( name: String , closure: A -> ( ) ) {
8183 addCommand ( name, Commander . command ( closure) )
@@ -90,4 +92,41 @@ extension Group {
9092 public func command< A: ArgumentConvertible , B: ArgumentConvertible , C: ArgumentConvertible > ( name: String , closure: ( A , B , C ) -> ( ) ) {
9193 addCommand ( name, Commander . command ( closure) )
9294 }
95+
96+ /// Add a command which takes four argument using a closure
97+ public func command< A: ArgumentConvertible , B: ArgumentConvertible , C: ArgumentConvertible , D: ArgumentConvertible > ( name: String , closure: ( A , B , C , D ) -> ( ) ) {
98+ addCommand ( name, Commander . command ( closure) )
99+ }
100+
101+ /// Add a command which takes five argument using a closure
102+ public func command< A: ArgumentConvertible , B: ArgumentConvertible , C: ArgumentConvertible , D: ArgumentConvertible , E: ArgumentConvertible > ( name: String , closure: ( A , B , C , D , E ) -> ( ) ) {
103+ addCommand ( name, Commander . command ( closure) )
104+ }
105+
106+ // MARK: Argument Description Commands
107+
108+ /// Add a command which takes one argument using a closure
109+ public func command< A: ArgumentDescriptor > ( name: String , a: A , closure: ( A . ValueType ) -> ( ) ) {
110+ addCommand ( name, Commander . command ( a, closure: closure) )
111+ }
112+
113+ /// Add a command which takes two argument using a closure
114+ public func command< A: ArgumentDescriptor , B: ArgumentDescriptor > ( name: String , a: A , b: B , closure: ( A . ValueType , B . ValueType ) -> ( ) ) {
115+ addCommand ( name, Commander . command ( a, b, closure: closure) )
116+ }
117+
118+ /// Add a command which takes three argument using a closure
119+ public func command< A: ArgumentDescriptor , B: ArgumentDescriptor , C: ArgumentDescriptor > ( name: String , a: A , b: B , c: C , closure: ( A . ValueType , B . ValueType , C . ValueType ) -> ( ) ) {
120+ addCommand ( name, Commander . command ( a, b, c, closure: closure) )
121+ }
122+
123+ /// Add a command which takes four argument using a closure
124+ public func command< A: ArgumentDescriptor , B: ArgumentDescriptor , C: ArgumentDescriptor , D: ArgumentDescriptor > ( name: String , a: A , b: B , c: C , d: D , closure: ( A . ValueType , B . ValueType , C . ValueType , D . ValueType ) -> ( ) ) {
125+ addCommand ( name, Commander . command ( a, b, c, d, closure: closure) )
126+ }
127+
128+ /// Add a command which takes five argument using a closure
129+ public func command< A: ArgumentDescriptor , B: ArgumentDescriptor , C: ArgumentDescriptor , D: ArgumentDescriptor , E: ArgumentDescriptor > ( name: String , a: A , b: B , c: C , d: D , e: E , closure: ( A . ValueType , B . ValueType , C . ValueType , D . ValueType , E . ValueType ) -> ( ) ) {
130+ addCommand ( name, Commander . command ( a, b, c, d, e, closure: closure) )
131+ }
93132}
0 commit comments