Merge pull request #5731 from epage/bash

fix(complete): Adjust how IFS is passed to clap
This commit is contained in:
Ed Page 2024-09-17 16:16:00 -04:00 committed by GitHub
commit 5ca60e9079
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -40,7 +40,7 @@ _clap_complete_NAME() {
local _CLAP_COMPLETE_SPACE=true
fi
COMPREPLY=( $( \
IFS="$IFS" \
_CLAP_IFS="$IFS" \
_CLAP_COMPLETE_INDEX="$_CLAP_COMPLETE_INDEX" \
_CLAP_COMPLETE_COMP_TYPE="$_CLAP_COMPLETE_COMP_TYPE" \
VAR="bash" \
@ -85,7 +85,7 @@ fi
let _space: Option<bool> = std::env::var("_CLAP_COMPLETE_SPACE")
.ok()
.and_then(|i| i.parse().ok());
let ifs: Option<String> = std::env::var("IFS").ok().and_then(|i| i.parse().ok());
let ifs: Option<String> = std::env::var("_CLAP_IFS").ok().and_then(|i| i.parse().ok());
let completions = crate::engine::complete(cmd, args, index, current_dir)?;
for (i, candidate) in completions.iter().enumerate() {

View file

@ -11,7 +11,7 @@ _clap_complete_exhaustive() {
local _CLAP_COMPLETE_SPACE=true
fi
COMPREPLY=( $( \
IFS="$IFS" \
_CLAP_IFS="$IFS" \
_CLAP_COMPLETE_INDEX="$_CLAP_COMPLETE_INDEX" \
_CLAP_COMPLETE_COMP_TYPE="$_CLAP_COMPLETE_COMP_TYPE" \
COMPLETE="bash" \