From a66a4aa04ad8c1b878c315b07842c2ae9dd3db31 Mon Sep 17 00:00:00 2001 From: briantrice Date: Wed, 10 Feb 2010 14:21:13 -0800 Subject: [PATCH] Added support for comma-based *rest parameters to the shell DNU hook. --- src/lib/platform.slate | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/lib/platform.slate b/src/lib/platform.slate index e1fccd2..ed04854 100644 --- a/src/lib/platform.slate +++ b/src/lib/platform.slate @@ -140,18 +140,21 @@ _@shell didNotUnderstand: message at: position ifTrue: [resend] ifFalse: [([| :command | - message selector isUnarySelector ifTrue: - [command ; message selector. - message optionals pairsDo: - [| :key :value | - command ; ' -' ; (key as: String) allButFirst allButLast ; ' ' ; (value as: String)]]. - message selector isKeywordSelector ifTrue: - [| keywords args | - keywords: ((message selector as: String) splitWith: $:). - command ; keywords first. - keywords size = 1 ifTrue: "Read a string or array of arguments." - [args: message arguments second. - (args is: String) ifTrue: [command ; ' ' ; args] - ifFalse: [args do: [| :arg | command ; ' ' ; arg]]]]] writingAs: String) - ifNil: [resend] ifNotNilDo: [| :cmd | [Platform run: cmd]]] + message selector isUnarySelector + ifTrue: + [command ; message selector. + message optionals pairsDo: + [| :key :value | + command ; ' -' ; (key as: String) allButFirst allButLast ; ' ' ; (value as: String)]]. + message selector isKeywordSelector ifTrue: + [| keywords args | + keywords: ((message selector as: String) splitWith: $:). + command ; keywords first. + keywords size = 1 ifTrue: "Read a string or array of arguments." + [args: message arguments second. + (args is: String) ifTrue: [command ; ' ' ; args] + ifFalse: [args do: [| :arg | command ; ' ' ; arg]]]]. + message arguments allButFirst: message selector arity do: + [| :arg | command ; ' ' ; (arg as: String)]] writingAs: String) + ifNil: [resend] ifNotNilDo: [| :cmd | [Platform run: cmd]]] ]. -- 2.11.4.GIT