@@ -13,6 +13,13 @@ use crate::clonable_command::ClonableCommand;
1313use crate :: ignore:: GlobMatcher ;
1414use crate :: normal_path:: NormalPath ;
1515
16+ /// An experimental feature that can be enabled with `--experimental-features`.
17+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , clap:: ValueEnum ) ]
18+ pub enum ExperimentalFeature {
19+ /// Enable TUI mode.
20+ Tui ,
21+ }
22+
1623/// Ghciwatch loads a GHCi session for a Haskell project and reloads it
1724/// when source files change.
1825#[ derive( Debug , Clone , Parser ) ]
@@ -62,7 +69,15 @@ pub struct Opts {
6269 #[ arg( long) ]
6370 pub no_interrupt_reloads : bool ,
6471
65- /// Enable TUI mode (experimental).
72+ /// Enable experimental features. These features are unsupported and may change or be removed
73+ /// without notice.
74+ ///
75+ /// Can be given multiple times.
76+ #[ arg( long = "experimental-features" , value_name = "FEATURE" , hide = true ) ]
77+ pub experimental_features : Vec < ExperimentalFeature > ,
78+
79+ /// Deprecated: use `--experimental-features tui` instead.
80+ // TODO: Remove after 2026-06-01.
6681 #[ arg( long, hide = true ) ]
6782 pub tui : bool ,
6883
@@ -211,6 +226,11 @@ pub struct LoggingOpts {
211226}
212227
213228impl Opts {
229+ /// Check whether a given experimental feature has been enabled.
230+ pub fn has_experimental_feature ( & self , feature : ExperimentalFeature ) -> bool {
231+ self . experimental_features . contains ( & feature)
232+ }
233+
214234 /// Perform late initialization of the command-line arguments. If `init` isn't called before
215235 /// the arguments are used, the behavior is undefined.
216236 pub fn init ( & mut self ) -> miette:: Result < ( ) > {
0 commit comments