break; case 'move': if (!$collection) { echo "Error: no collection in use.\n"; break; } elseif (!$input[1]) { echo "Error: no node ID specified.\n"; break; } elseif (!$input[2]) { echo "Error: no new parent ID specified.\n"; break; } array_shift($input); $id = array_shift($input); $np = array_shift($input); $res = $ns->move($id, $np); if (!$res) { echo 'Error: ' . $ns->error . "\n"; break; } echo "Node moved.\n"; break; case 'rename': if (!$collection) { echo "Error: no collection in use.\n"; break; } elseif (!$input[1]) { echo "Error: no node ID specified.\n"; break; } elseif (!$input[2]) { echo "Error: no new node ID specified.\n";