Dynamically calculate needed size for command.

Closes #26.