Man charged after allegedly charging at officer with knife