mirror of
https://github.com/reactos/ninja.git
synced 2024-11-23 03:39:48 +00:00
Speed-up bash target auto-complete.
These speed-ups include: * Let compgen do the command substitution. Similar to https://lists.gnu.org/archive/html/bug-bash/2012-03/msg00115.html * Use "cut" instead of "awk" for separating fields.
This commit is contained in:
parent
083b6b0406
commit
fc135c456d
@ -49,9 +49,8 @@ _ninja_target() {
|
|||||||
C) eval dir="$OPTARG" ;;
|
C) eval dir="$OPTARG" ;;
|
||||||
esac
|
esac
|
||||||
done;
|
done;
|
||||||
targets_command="eval ninja -C \"${dir}\" -t targets all"
|
targets_command="eval ninja -C \"${dir}\" -t targets all 2>/dev/null | cut -d: -f1"
|
||||||
targets=$(${targets_command} 2>/dev/null | awk -F: '{print $1}')
|
COMPREPLY=($(compgen -W '`${targets_command}`' -- "$cur"))
|
||||||
COMPREPLY=($(compgen -W "$targets" -- "$cur"))
|
|
||||||
fi
|
fi
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user