ENH: Change REMOVE and REMOVE_ITEM to REMOVE_AT and REMOVE_ITEM
This commit is contained in:
parent
3b92585cf0
commit
cb2a9be622
|
@ -46,9 +46,9 @@ bool cmListCommand::InitialPass(std::vector<std::string> const& args)
|
|||
{
|
||||
return this->HandleInsertCommand(args);
|
||||
}
|
||||
if(subCommand == "REMOVE")
|
||||
if(subCommand == "REMOVE_AT")
|
||||
{
|
||||
return this->HandleRemoveCommand(args);
|
||||
return this->HandleRemoveAtCommand(args);
|
||||
}
|
||||
if(subCommand == "REMOVE_ITEM")
|
||||
{
|
||||
|
@ -250,7 +250,8 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmListCommand::HandleRemoveCommand(std::vector<std::string> const& args)
|
||||
bool cmListCommand
|
||||
::HandleRemoveItemCommand(std::vector<std::string> const& args)
|
||||
{
|
||||
if(args.size() < 3)
|
||||
{
|
||||
|
@ -295,8 +296,7 @@ bool cmListCommand::HandleRemoveCommand(std::vector<std::string> const& args)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmListCommand
|
||||
::HandleRemoveItemCommand(std::vector<std::string> const& args)
|
||||
bool cmListCommand::HandleRemoveAtCommand(std::vector<std::string> const& args)
|
||||
{
|
||||
if(args.size() < 3)
|
||||
{
|
||||
|
|
|
@ -69,8 +69,8 @@ public:
|
|||
"<output variable>)\n"
|
||||
" LIST(APPEND <list> <element> [<element> ...])\n"
|
||||
" LIST(INSERT <list> <element_index> <element> [<element> ...])\n"
|
||||
" LIST(REMOVE <list> <value> [<value> ...])\n"
|
||||
" LIST(REMOVE_ITEM <list> <index> [<index> ...])\n"
|
||||
" LIST(REMOVE_ITEM <list> <value> [<value> ...])\n"
|
||||
" LIST(REMOVE_AT <list> <index> [<index> ...])\n"
|
||||
" LIST(SORT <list>)\n"
|
||||
" LIST(REVERSE <list>)\n"
|
||||
"LENGTH will return a given list's length.\n"
|
||||
|
@ -79,8 +79,8 @@ public:
|
|||
"INSERT will insert elements to the list to the specified location.\n"
|
||||
"When specifying an index, negative value corresponds to index from the"
|
||||
" end of the list.\n"
|
||||
"REMOVE and REMOVE_ITEM will remove item from the list. The difference "
|
||||
"is that REMOVE will remove the given items, while REMOVE_ITEM will "
|
||||
"REMOVE_AT and REMOVE_ITEM will remove item from the list. The difference "
|
||||
"is that REMOVE_ITEM will remove the given items, while REMOVE_AT will "
|
||||
"remove the item at the given indices.\n"
|
||||
;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ protected:
|
|||
bool HandleGetCommand(std::vector<std::string> const& args);
|
||||
bool HandleAppendCommand(std::vector<std::string> const& args);
|
||||
bool HandleInsertCommand(std::vector<std::string> const& args);
|
||||
bool HandleRemoveCommand(std::vector<std::string> const& args);
|
||||
bool HandleRemoveAtCommand(std::vector<std::string> const& args);
|
||||
bool HandleRemoveItemCommand(std::vector<std::string> const& args);
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ MACRO(TEST command expected)
|
|||
IF("x${result}" STREQUAL "x${expected}")
|
||||
MESSAGE("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"")
|
||||
ELSE("x${result}" STREQUAL "x${expected}")
|
||||
MESSAGE(SEND_ERROR "TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
|
||||
MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
|
||||
ENDIF("x${result}" STREQUAL "x${expected}")
|
||||
ENDMACRO(TEST command expected)
|
||||
|
||||
|
@ -48,13 +48,17 @@ LIST(INSERT result -1 bill ken)
|
|||
TEST("INSERT result -1 bill ken" "andy;bill;ken;brad")
|
||||
|
||||
SET(result andy bill brad ken bob)
|
||||
LIST(REMOVE result bob)
|
||||
TEST("REMOVE result bob" "andy;bill;brad;ken")
|
||||
LIST(REMOVE_ITEM result bob)
|
||||
TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken")
|
||||
|
||||
SET(result andy bill bob brad ken peter)
|
||||
LIST(REMOVE result peter bob)
|
||||
TEST("REMOVE result peter bob" "andy;bill;brad;ken")
|
||||
LIST(REMOVE_ITEM result peter bob)
|
||||
TEST("REMOVE_ITEM result peter bob" "andy;bill;brad;ken")
|
||||
|
||||
SET(result bob andy bill bob brad ken bob)
|
||||
LIST(REMOVE_ITEM result bob)
|
||||
TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken")
|
||||
|
||||
SET(result andy bill bob brad ken peter)
|
||||
LIST(REMOVE_ITEM result 2 -1)
|
||||
TEST("REMOVE_ITEM result 2 -1" "andy;bill;brad;ken")
|
||||
LIST(REMOVE_AT result 2 -1)
|
||||
TEST("REMOVE_AT result 2 -1" "andy;bill;brad;ken")
|
||||
|
|
Loading…
Reference in New Issue