Added -i flag to use stdin as input.