how to change the shape of the end of the line

I would like to Cap type . Square, as here