From dc8d603f988218b6e4fe9dba77f3b62323883182 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 29 Apr 2018 01:57:45 -0700 Subject: [PATCH] Add a qmark-noglob feature flag This adds a feature flag for controlling whether question marks are globs. It is not yet hooked up. --- src/future_feature_flags.cpp | 1 + src/future_feature_flags.h | 23 +++++++++++++---------- tests/status.out | 1 + 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/future_feature_flags.cpp b/src/future_feature_flags.cpp index 276ea32f2..2cafa4533 100644 --- a/src/future_feature_flags.cpp +++ b/src/future_feature_flags.cpp @@ -12,6 +12,7 @@ features_t &mutable_fish_features() { return global_features; } const features_t::metadata_t features_t::metadata[features_t::flag_count] = { {stderr_nocaret, L"stderr-nocaret", L"3.0", L"^ no longer redirects stderr"}, + {qmark_noglob, L"qmark-noglob", L"3.0", L"? no longer globs"}, }; const struct features_t::metadata_t *features_t::metadata_for(const wchar_t *name) { diff --git a/src/future_feature_flags.h b/src/future_feature_flags.h index 6765252e9..2f9aec788 100644 --- a/src/future_feature_flags.h +++ b/src/future_feature_flags.h @@ -10,18 +10,21 @@ class features_t { public: /// The list of flags. - enum flag_t { - /// Whether ^ is supported for stderr redirection. - stderr_nocaret, + enum flag_t { + /// Whether ^ is supported for stderr redirection. + stderr_nocaret, - /// The number of flags. - flag_count - }; + /// Whether ? is supported as a glob. + qmark_noglob, - /// Return whether a flag is set. - bool test(flag_t f) const { - assert(f >= 0 && f < flag_count && "Invalid flag"); - return values[f]; + /// The number of flags. + flag_count + }; + + /// Return whether a flag is set. + bool test(flag_t f) const { + assert(f >= 0 && f < flag_count && "Invalid flag"); + return values[f]; } /// Set a flag. diff --git a/tests/status.out b/tests/status.out index 1553d674a..ea2ab205e 100644 --- a/tests/status.out +++ b/tests/status.out @@ -5,5 +5,6 @@ test_function #################### # Future Feature Flags stderr-nocaret off 3.0 ^ no longer redirects stderr +qmark-noglob off 3.0 ? no longer globs 1 2