There should be no functional change after this commit, this is mostly
just a code cleanup in the list_command function.
I have inlined local variables into the function body, changing 'int'
to 'bool' where appropriate, and updating 'if' conditions to avoid
treating non-bools as a bool.
I also make more use of list_around_line towards the end of the
list_command function, which avoids some code duplication, but
shouldn't be a functional change.