forked from extern/nushell
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:
@ -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,
|
||||
|
@ -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>>,
|
||||
|
Reference in New Issue
Block a user