task :taskname, :arg1, :arg2 do|t, args|
p "Executing task #{t} with Argument #{args.arg1} and #{args.arg2}"
endYou invoke the task as follows
rake taskname[arg1,arg2]
(Not that there is no space between the arguments)
OR
rake taskname"[arg1, arg2]"
(Note space between arguments is ok here.