Visibility of aliases was incorrectly handled before, this has been resolved. The environment variables have now also been merged into the alias list, which is a more sensible place for it to go.
YBAXVS44BAEHH6KDZRQEYKRCYZPKDEQ2TFOXAPGHQNZOBYWVUGWAC
fn aliases(arg: &Arg) -> impl ViewSequence<Arg> {
let mut aliases = Vec::new();
// Handle short aliases (-a, -b etc)
if let Some(long_aliases) = arg.get_short_and_visible_aliases() {
aliases.extend(
long_aliases
.iter()
.map(|alias| alias.to_string())
.filter(|alias| alias != arg.get_id()),
);
}
fn env(arg: &Arg) -> impl ViewSequence<Arg> {
arg.get_env()
.map(|variable| variable.to_string_lossy().to_string())
.map(el::span)
}
// Handle long aliases (--alias1, --alias2 etc)
if let Some(long_aliases) = arg.get_long_and_visible_aliases() {
aliases.extend(
long_aliases
.iter()
.map(|alias| alias.to_string())
.filter(|alias| alias != arg.get_id()),
);
}
fn aliases(arg: &Arg) -> impl ViewSequence<Arg> {
let aliases = if let Some(aliases) = arg.get_all_aliases() {
aliases
.iter()
.map(|alias| alias.to_string())
.filter(|alias| alias != arg.get_id())
.collect::<Vec<String>>()
} else {
// Ignore if there's no aliases
return None;
};
// Handle environment variables
if let Some(env_var) = arg.get_env() {
aliases.push(env_var.to_string_lossy().to_string())
}