tool_operate: Moved command line argument parsing into separate function