I'd like to change the style of the line that runs along the side of a statement block in a pseudocode algorithm typeset using the algorithm environment of the algorithm2e package. Here's the initial example code:
\documentclass{article}
\usepackage[ruled,noend]{algorithm2e}
\begin{document}
\begin{algorithm}
\caption{A simple algorithm.}
\Begin
{
\ForEach{item}
{
\ForEach{sub-item}
{
do something.\\
}
}
}
\end{algorithm}
\end{document}
This produces:
But I'd like to add little endcaps on the lines and adjust the spacing a bit. Here's what I'd like to achieve:


