add some basic tools for getting command len