Setting hostname via scutil
The prompt is the interactive mode of scutil which usually is invoked by the single command scutil without options. To quit the interactive mode enter quit at the prompt.

In your case you are simply using the wrong dash: probably the en-dash (UTF-8: U+2013 - e2 80 93) and a normal dash and your whole command is interpreted as scutil only.

Instead of sudo scutil –-set HostName doriath use sudo scutil --set HostName doriath!