Add truncate command while generalizing error code
Merge pull request #16 from ilyakava/truncate

Add truncate command while generalizing error code