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 bitcoin-tx(1)2# Copyright (c) 2016-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_bitcoin_tx() {7local cur prev words=() cword8local bitcoin_tx10# save and use original argument to invoke bitcoin-tx for -help11# it might not be in $PATH12bitcoin_tx="$1"14COMPREPLY=()15_get_comp_words_by_ref -n =: cur prev words cword17case "$cur" in18load=*:*)19cur="${cur#load=*:}"20_filedir21return 022;;23*=*) # prevent attempts to complete other arguments24return 025;;26esac28if [[ "$cword" == 1 || ( "$prev" != "-create" && "$prev" == -* ) ]]; then29# only options (or an uncompletable hex-string) allowed30# parse bitcoin-tx -help for options31local helpopts32helpopts=$($bitcoin_tx -help | sed -e '/^ -/ p' -e d )33COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) )34else35# only commands are allowed36# parse -help for commands37local helpcmds38helpcmds=$($bitcoin_tx -help | sed -e '1,/Commands:/d' -e 's/=.*/=/' -e '/^ [a-z]/ p' -e d )39COMPREPLY=( $( compgen -W "$helpcmds" -- "$cur" ) )40fi42# Prevent space if an argument is desired43if [[ $COMPREPLY == *= ]]; then44compopt -o nospace45fi47return 048} &&49complete -F _bitcoin_tx bitcoin-tx51# Local variables:52# mode: shell-script53# sh-basic-offset: 454# sh-indent-comment: t55# indent-tabs-mode: nil56# End:57# 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.