command parser for use with Spark.function()