Al-Adab Al-Mufrad, Book 43, Hadith 41 (In-Book)

Anas ibn Malik reported that a bedouin came to the house of the Messenger of Allah, may Allah bless him and grant him peace, and put his eye to the crack of the door. Therefore the Prophet took an arrow or a sharp stick and aimed it at the bedouin as to gouge out his eye. The man left and the Prophet said, "If you had stayed, I would have gouged out your eye."

حَدَّثَنَا مُوسَى، قَالَ‏:‏ حَدَّثَنَا أَبَانُ بْنُ يَزِيدَ قَالَ‏:‏ حَدَّثَنِي يَحْيَى، أَنَّ إِسْحَاقَ بْنَ عَبْدِ اللهِ حَدَّثَهُ، عَنْ أَنَسِ بْنِ مَالِكٍ، أَنَّ أَعْرَابِيًّا أَتَى بَيْتَ رَسُولِ اللهِ صلى الله عليه وسلم فَأَلْقَمَ عَيْنَهُ خَصَاصَةَ الْبَابِ، فَأَخَذَ سَهْمًا أَوْ عُودًا مُحَدَّدًا، فَتَوَخَّى الأعْرَابِيَّ، لِيَفْقَأَ عَيْنَ الأعْرَابِيِّ، فَذَهَبَ، فَقَالَ‏:‏ أَمَا إِنَّكَ لَوْ ثَبَتَّ لَفَقَأْتُ عَيْنَكَ‏.‏

sunnah.com