Any person subject to this code who compels or attempts to compel the commander of any of the organized militia of the state, or of any other state, to give it up to an enemy or to abandon it, or who strikes the colors or flag to an enemy without proper authority, shall be punished as a court-martial may direct.