Make which-support feature non-optional (#13125)

# Description
Removes the `which-support` cargo feature and makes all of its
feature-gated code enabled by default in all builds. I'm not sure why
this one command is gated behind a feature. It seems to be a relic of
older code where we had features for what seems like every command.
This commit is contained in:
Ian Manske
2024-06-13 01:04:12 +00:00
committed by GitHub
parent bdbb096526
commit 634361b2d1
12 changed files with 1 additions and 51 deletions

View File

@ -134,7 +134,6 @@ workspace = true
plugin = ["nu-parser/plugin"]
sqlite = ["rusqlite"]
trash-support = ["trash"]
which-support = []
[dev-dependencies]
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.94.3" }

View File

@ -127,7 +127,7 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState {
SysTemp,
SysUsers,
UName,
Which,
};
// Help
@ -172,9 +172,6 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState {
))]
bind_command! { Ps };
#[cfg(feature = "which-support")]
bind_command! { Which };
// Strings
bind_command! {
Char,

View File

@ -92,7 +92,6 @@ fn get_entries_in_nu(
all_entries
}
#[cfg(feature = "which-support")]
fn get_first_entry_in_path(
item: &str,
span: Span,
@ -104,17 +103,6 @@ fn get_first_entry_in_path(
.ok()
}
#[cfg(not(feature = "which-support"))]
fn get_first_entry_in_path(
_item: &str,
_span: Span,
_cwd: impl AsRef<Path>,
_paths: impl AsRef<OsStr>,
) -> Option<Value> {
None
}
#[cfg(feature = "which-support")]
fn get_all_entries_in_path(
item: &str,
span: Span,
@ -129,16 +117,6 @@ fn get_all_entries_in_path(
.unwrap_or_default()
}
#[cfg(not(feature = "which-support"))]
fn get_all_entries_in_path(
_item: &str,
_span: Span,
_cwd: impl AsRef<Path>,
_paths: impl AsRef<OsStr>,
) -> Vec<Value> {
vec![]
}
#[derive(Debug)]
struct WhichArgs {
applications: Vec<Spanned<String>>,

View File

@ -125,7 +125,6 @@ mod upsert;
mod url;
mod use_;
mod where_;
#[cfg(feature = "which-support")]
mod which;
mod while_;
mod with_env;