Skip to content

Commit

Permalink
fix an error completion of cargo run --example
Browse files Browse the repository at this point in the history
  • Loading branch information
nanpuyue committed Jan 22, 2019
1 parent 907c0fe commit 3b5b574
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/etc/cargo.bashcomp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ _benchmark_names()
}

_get_examples(){
local files=($(dirname $(_locate_manifest))/examples/*.rs)
local manifest=$(_locate_manifest)
[ -z "$manifest" ] && return 0

local files=("${manifest%/*}"/examples/*.rs)
local names=("${files[@]##*/}")
local names=("${names[@]%.*}")
# "*" means no examples found
Expand Down

0 comments on commit 3b5b574

Please sign in to comment.