break; case 'delete': if (!$collection) { echo "Error: no collection in use.\n"; break; } elseif (!$input[1]) { echo "Error: no node ID specified.\n"; break; } echo "Are you sure you want to delete the node '" . $input[1] . "'? (yes|no)\n"; $in = explode(' ', trim(fgets(STDIN))); if ($in[0] != 'yes') { echo "Aborted.\n"; break; } $res = $ns->delete($input[1]); if (!$res) { echo 'Error: ' . $ns->error . "\n"; break; } echo "Node deleted.\n"; break; case 'deleteBranch': if (!$collection) { echo "Error: no collection in use.\n"; break; } elseif (!$input[1]) { echo "Error: no node ID specified.\n"; break; } echo "Are you sure you want to delete the branch '" . $input[1] . "'? (yes|no)\n";