added the list command

This should easily merge the original pull request (#586)