Fix handling of option with required value that is not set

If an option that requires a value is not set on the command line it
currently adds the option to the command line string without a value.
Example: --mode=
Where the value is actually null.
If an option like this is not set it should be omitted all together.