ui-cli: wrap main code in a 'case $action' block

Prepare for merging plan-edit.