Skip to content

Commit

Permalink
Merge pull request #5731 from epage/bash
Browse files Browse the repository at this point in the history
fix(complete): Adjust how IFS is passed to clap
  • Loading branch information
epage authored Sep 17, 2024
2 parents df1efca + 5d7c16c commit 5ca60e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions clap_complete/src/env/shells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down

0 comments on commit 5ca60e9

Please sign in to comment.