mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
Merge pull request #5731 from epage/bash
fix(complete): Adjust how IFS is passed to clap
This commit is contained in:
commit
5ca60e9079
2 changed files with 3 additions and 3 deletions
4
clap_complete/src/env/shells.rs
vendored
4
clap_complete/src/env/shells.rs
vendored
|
@ -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() {
|
||||
|
|
|
@ -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" \
|
||||
|
|
Loading…
Reference in a new issue