@Cmd("select")
    Task select(final @Arg("tree|string:*|Volume and and/or tree specification") String tstring,
            final @Arg("_flag|r|Regular expression") boolean r) throws Exception {

        return new Task() {

            @Override
            public void runTask() throws Exception {

                _currentTree = null;
                _currentVolume = null;

                if (_persistit == null) {
                    postMessage("Persistit not loaded", LOG_NORMAL);
                    return;
                }

                List<Object> selected = new ArrayList<Object>();
                final TreeSelector selector = TreeSelector.parseSelector(tstring, r, '\\');

                for (final Volume volume : _persistit.getVolumes()) {
                    if (selector.isVolumeNameSelected(volume.getName())) {
                        if (selector.isVolumeOnlySelection(volume.getName())) {
                            selected.add(volume);
                        } else {
                            for (final String treeName : volume.getTreeNames()) {
                                if (selector.isTreeNameSelected(volume.getName(), treeName)) {
                                    selected.add(volume.getTree(treeName, false));
                                }
                            }
                        }
                    }

                }
                if (selected.isEmpty()) {
                    postMessage("No volumes or trees selected", LOG_NORMAL);
                    return;
                }
                if (selected.size() > 1) {
                    postMessage("Too many volumes or trees selected: " + selected, LOG_NORMAL);
                    return;
                }

                if (selected.get(0) instanceof Volume) {
                    _currentVolume = (Volume) selected.get(0);
                    _currentTree = null;
                    postMessage(String.format("Volume %s selected", _currentVolume), LOG_NORMAL);
                } else {
                    _currentTree = (Tree) selected.get(0);
                    _currentVolume = _currentTree.getVolume();
                    postMessage(String.format("Volume %s tree %s selected", _currentVolume, _currentTree), LOG_NORMAL);
                }

            }

            @Override
            public String getStatus() {
                return "";
            }
        };
    }