Send 'length' command line option as 'count' to API

fixes #251