Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# bash programmable completion for bitcoind(1) and bitcoin-qt(1)2# Copyright (c) 2012-present The Bitcoin Core developers3# Distributed under the MIT software license, see the accompanying4# file COPYING or http://www.opensource.org/licenses/mit-license.php.6_bitcoind() {7local cur prev words=() cword8local bitcoind10# save and use original argument to invoke bitcoind for -help11# it might not be in $PATH12bitcoind="$1"14COMPREPLY=()15_get_comp_words_by_ref -n = cur prev words cword17case "$cur" in18-conf=*|-pid=*|-loadblock=*|-rpccookiefile=*|-wallet=*)19cur="${cur#*=}"20_filedir21return 022;;23-datadir=*)24cur="${cur#*=}"25_filedir -d26return 027;;28-*=*) # prevent nonsense completions29return 030;;31*)33# only parse -help if sensible34if [[ -z "$cur" || "$cur" =~ ^- ]]; then35local helpopts36helpopts=$($bitcoind -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' )37COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) )38fi40# Prevent space if an argument is desired41if [[ $COMPREPLY == *= ]]; then42compopt -o nospace43fi44return 045;;46esac47} &&48complete -F _bitcoind bitcoind bitcoin-qt50# Local variables:51# mode: shell-script52# sh-basic-offset: 453# sh-indent-comment: t54# indent-tabs-mode: nil55# End:56# ex: ts=4 sw=4 et filetype=sh
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.