Drop entries from list of flags by name, name/value pair, or index

cmd_list_drop(flags, drop)

Arguments

flags

named list output of cmd_list_interp

drop

vector of flag entries to drop. Pass a character vector to drop flags by name. Pass a named vector to drop flags by name/value pairs. Pass a numeric vector to drop by position.

Value

flags list with values in drop removed

Examples

exFlags <- list("flag1" = 2, "flag2" = "someText") cmd_list_drop(exFlags, "flag1")
#> $flag2 #> [1] "someText" #>
# will drop flag2 because its name and value match 'drop' vector cmd_list_drop(exFlags, c("flag2" = "someText"))
#> $flag1 #> [1] 2 #>
# Will drop "flag1" by position index cmd_list_drop(exFlags, 1)
#> $flag2 #> [1] "someText" #>
# won't drop flag2 because its value isn't 'someText' exFlags2 <- list("flag1" = 2, "flag2" = "otherText") cmd_list_drop(exFlags, c("flag2" = "someText"))
#> $flag1 #> [1] 2 #>