This is what I am referring to: https://github.com/CodingCat/incubator-spark/blob/spark_shell_improve/bin/spark-class#L93