Allow commands invoked through command-prompt to access selected items/units/buildings

Fixes #273