mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-22 15:51:18 -03:00
cleanup env code and contains()
Switch from null terminated arrays to `wcstring_list_t` for lists of special env var names. Rename `list_contains_string` to `contains` and modify the latter interface to not rely on a `#define`. Rename `list_contains_string()` to `contains()` and eliminate the current variadic implementation. Update all callers of the removed version to use the string list version.
This commit is contained in:
@@ -1055,7 +1055,9 @@ static const parse_token_t kInvalidToken = {
|
||||
static const parse_token_t kTerminalToken = {
|
||||
parse_token_type_terminate, parse_keyword_none, false, false, SOURCE_OFFSET_INVALID, 0};
|
||||
|
||||
static inline bool is_help_argument(const wcstring &txt) { return contains(txt, L"-h", L"--help"); }
|
||||
static inline bool is_help_argument(const wcstring &txt) {
|
||||
return txt == L"-h" || txt == L"--help";
|
||||
}
|
||||
|
||||
/// Return a new parse token, advancing the tokenizer.
|
||||
static inline parse_token_t next_parse_token(tokenizer_t *tok, tok_t *token) {
|
||||
|
||||
Reference in New Issue
Block a user