if eligible for voluntary retirement under any provision of law on the date of such removal, be retired in the grade and with the retired pay for which he would be eligible if retired under such provision; and

(2) if ineligible for voluntary retirement under any provision of law on the date of such removal—

(A)

be honorably discharged in the grade then held, in the case of an officer whose case was brought under subsection (a) of section 1181 of this title; or

(B)

be discharged in the grade then held, in the case of an officer whose case was brought under subsection (b) of section 1181 of this title.