[bugfix] command line overwritten by build params

Fixed a bug that caused the command line to be overwritten by actual
build params if used.
Add a unit test to fix corrected by pull #4