merge cmd flag and pwm value to one func.