mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Auto merge of #6578 - nanpuyue:patch-1, r=ehuss
fix an error completion of `cargo run --example`
This commit is contained in:
commit
edcc37e6c4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user