Adding buildCommandLine function

buildCommandLine function is not finished yet !!