-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: bitcoin#17786, #24611, #25934, #26298, #26508, #26545, #26561, #26569, #26609, partial #26238 #7648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
13d68ae
365b511
932b43f
75ab344
64d6b5d
a1f7787
caf205f
8fc6672
b09c320
9517a2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # Disable files from being included in completions by default | ||
| complete --command dash-cli --no-files | ||
|
|
||
| function __fish_dash_cli_get_commands_helper | ||
| set --local cmd (commandline -oc) | ||
|
|
||
| # Don't return commands if '-help or -?' in commandline | ||
| if string match --quiet --regex -- '^-help$|^-\?$' $cmd | ||
| return | ||
| end | ||
|
|
||
| # Strip help cmd from token to avoid duplication errors | ||
| set --local cmd (string match --invert --regex -- '^help$' $cmd) | ||
| # Strip -stdin* options to avoid waiting for input while we fetch completions | ||
| # TODO: this appears to be broken when run as tab completion (requires ctrl+c to exit) | ||
| set --local cmd (string match --invert --regex -- '^-stdin.*$' $cmd) | ||
|
|
||
| # Match, format and return commands | ||
| for command in ($cmd help 2>&1 | string match --invert -r '^\=\=.*' | string match --invert -r '^\\s*$') | ||
| echo $command | ||
| end | ||
| end | ||
|
|
||
| function __fish_dash_cli_get_commands | ||
| argparse 'nohelp' 'commandsonly' -- $argv | ||
| set --local commands | ||
|
|
||
| # Exclude description, exclude help | ||
| if set -q _flag_nohelp; and set -q _flag_commandsonly | ||
| set --append commands (__fish_dash_cli_get_commands_helper | string replace -r ' .*$' '' | string match --invert -r 'help') | ||
| # Include description, exclude help | ||
| else if set -q _flag_nohelp | ||
| set --append commands (__fish_dash_cli_get_commands_helper | string replace ' ' \t | string match --invert -r 'help') | ||
| # Exclude description, include help | ||
| else if set -q _flag_commandsonly | ||
| set --append commands (__fish_dash_cli_get_commands_helper | string replace -r ' .*$' '') | ||
| # Include description, include help | ||
| else | ||
| set --append commands (__fish_dash_cli_get_commands_helper | string replace ' ' \t) | ||
| end | ||
|
|
||
| if string match -q -r '^.*error.*$' $commands[1] | ||
| # RPC offline or RPC wallet not loaded | ||
| return | ||
| else | ||
| for command in $commands | ||
| echo $command | ||
| end | ||
| end | ||
| end | ||
|
|
||
|
|
||
| function __fish_dash_cli_get_options | ||
| argparse 'nofiles' -- $argv | ||
| set --local cmd (commandline -oc) | ||
| # Don't return options if '-help or -?' in commandline | ||
| if string match --quiet --regex -- '^-help$|-\?$' $cmd | ||
| return | ||
| end | ||
| set --local options | ||
|
|
||
| if set -q _flag_nofiles | ||
| set --append options ($cmd -help 2>&1 | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=' | string match --invert -r '^.*=$') | ||
| else | ||
| set --append options ($cmd -help 2>&1 | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=' | string match -r '^.*=$') | ||
| end | ||
|
|
||
| for option in $options | ||
| echo $option | ||
| end | ||
| end | ||
|
|
||
| # Add options with file completion | ||
| # Don't offer after a command is given | ||
| complete \ | ||
| --command dash-cli \ | ||
| --no-files \ | ||
| --condition "not __fish_seen_subcommand_from (__fish_dash_cli_get_commands --commandsonly)" \ | ||
| --arguments "(__fish_dash_cli_get_options)" | ||
| # Enable file completions only if the commandline now contains a `*.=` style option | ||
| complete --command dash-cli \ | ||
| --condition 'string match --regex -- ".*=" (commandline -pt)' \ | ||
| --force-files | ||
|
|
||
| # Add options without file completion | ||
| # Don't offer after a command is given | ||
| complete \ | ||
| --command dash-cli \ | ||
| --no-files \ | ||
| --condition "not __fish_seen_subcommand_from (__fish_dash_cli_get_commands --commandsonly)" \ | ||
| --arguments "(__fish_dash_cli_get_options --nofiles)" | ||
|
|
||
| # Add commands | ||
| # Permit command completions after `dash-cli help` but not after other commands | ||
| complete \ | ||
| --command dash-cli \ | ||
| --no-files \ | ||
| --condition "not __fish_seen_subcommand_from (__fish_dash_cli_get_commands --commandsonly --nohelp)" \ | ||
| --arguments "(__fish_dash_cli_get_commands)" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Disable files from being included in completions by default | ||
| complete --command dash-qt --no-files | ||
|
|
||
| # Extract options | ||
| function __fish_dashqt_get_options | ||
| argparse 'nofiles' -- $argv | ||
| set --local cmd (commandline -opc)[1] | ||
| set --local options | ||
|
|
||
| if set -q _flag_nofiles | ||
| set --append options ($cmd -help-debug | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=' | string match --invert -r '^.*=$') | ||
| else | ||
| set --append options ($cmd -help-debug | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=' | string match -r '^.*=$') | ||
| end | ||
|
|
||
| for option in $options | ||
| echo $option | ||
| end | ||
| end | ||
|
|
||
|
|
||
| # Add options with file completion | ||
| complete \ | ||
| --command dash-qt \ | ||
| --arguments "(__fish_dashqt_get_options)" | ||
| # Enable file completions only if the commandline now contains a `*.=` style option | ||
| complete -c dash-qt \ | ||
| --condition 'string match --regex -- ".*=" (commandline -pt)' \ | ||
| --force-files | ||
|
|
||
| # Add options without file completion | ||
| complete \ | ||
| --command dash-qt \ | ||
| --arguments "(__fish_dashqt_get_options --nofiles)" | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,65 @@ | ||||||
| # Disable files from being included in completions by default | ||||||
| complete --command dash-tx --no-files | ||||||
|
|
||||||
| # Modified version of __fish_seen_subcommand_from | ||||||
| # Uses regex to detect cmd= syntax | ||||||
| function __fish_dash_seen_cmd | ||||||
| set -l cmd (commandline -oc) | ||||||
| set -e cmd[1] | ||||||
| for i in $cmd | ||||||
| for j in $argv | ||||||
| if string match --quiet --regex -- "^$j.*" $i | ||||||
| return 0 | ||||||
| end | ||||||
| end | ||||||
| end | ||||||
| return 1 | ||||||
| end | ||||||
|
|
||||||
| # Extract options | ||||||
| function __fish_dash_tx_get_options | ||||||
| set --local cmd (commandline -oc)[1] | ||||||
| if string match --quiet --regex -- '^-help$|-\?$' $cmd | ||||||
| return | ||||||
| end | ||||||
|
|
||||||
| for option in ($cmd -help 2>&1 | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=') | ||||||
| echo $option | ||||||
| end | ||||||
| end | ||||||
|
|
||||||
| # Extract commands | ||||||
| function __fish_dash_tx_get_commands | ||||||
| argparse 'commandsonly' -- $argv | ||||||
| set --local cmd (commandline -oc)[1] | ||||||
| set --local commands | ||||||
|
|
||||||
| if set -q _flag_commandsonly | ||||||
| set --append commands ($cmd -help | sed -e '1,/Commands:/d' -e 's/=/=\t/' -e 's/(=/=/' -e '/^ [a-z]/ p' -e d | string replace -r '\ \ ' '' | string replace -r '=.*' '') | ||||||
| else | ||||||
| set --append commands ($cmd -help | sed -e '1,/Commands:/d' -e 's/=/=\t/' -e 's/(=/=/' -e '/^ [a-z]/ p' -e d | string replace -r '\ \ ' '') | ||||||
| end | ||||||
|
|
||||||
| for command in $commands | ||||||
| echo $command | ||||||
| end | ||||||
| end | ||||||
|
|
||||||
| # Add options | ||||||
| complete \ | ||||||
| --command dash-tx \ | ||||||
| --condition "not __fish_dash_seen_cmd (__fish_bitcoin_tx_get_commands --commandsonly)" \ | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Whenever Fish evaluates option completions for AGENTS.md reference: AGENTS.md:L197-L202 Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- repository conventions ---'
find /tmp/coderabbit-repo-knowledge/dashpay-dash-9d8ac790 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- target completion file ---'
sed -n '1,90p' contrib/completions/fish/dash-tx.fish
printf '%s\n' '--- helper definitions and references ---'
rg -n --glob '*.fish' '__fish_(dash_tx|bitcoin_tx)_get_commands|__fish_dash_seen_cmd' contrib/completions/fishRepository: dashpay/dash Length of output: 3863 🏁 Script executed: printf '%s\n' '--- repository-wide helper bindings ---'
rg -n '__fish_bitcoin_tx_get_commands|__fish_dash_tx_get_commands|dash-tx.fish|bitcoin-tx.fish' .
printf '%s\n' '--- fish completion files ---'
git ls-files 'contrib/completions/fish/*'
printf '%s\n' '--- scoped repository conventions ---'
cat /tmp/coderabbit-repo-knowledge/dashpay-dash-9d8ac790/conventions/repo-wide.mdRepository: dashpay/dash Length of output: 991 🌐 Web query:
💡 Result: In the Fish shell, command substitution ( Citations:
Use the defined Dash command helper. Line 51 calls the unresolved Replace it with 🤖 Prompt for AI AgentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: Incomplete bitcoin#24611 adaptation invokes an undefined Fish helper The upstream helper was renamed to __fish_dash_tx_get_commands in the Dash completion, but this condition still calls __fish_bitcoin_tx_get_commands. No such function is defined by the added Dash completion files, so Fish reports an unknown command while evaluating dash-tx option completions; if separate Bitcoin completions are installed, it may instead consume commands from the wrong binary. Call the helper defined on line 32.
Suggested change
source: ['claude'] |
||||||
| --arguments "(__fish_dash_tx_get_options)" \ | ||||||
| --no-files | ||||||
|
|
||||||
| # Add commands | ||||||
| complete \ | ||||||
| --command dash-tx \ | ||||||
| --arguments "(__fish_dash_tx_get_commands)" \ | ||||||
| --no-files | ||||||
|
|
||||||
| # Add file completions for load and set commands | ||||||
| complete \ | ||||||
| --command dash-tx \ | ||||||
| --condition 'string match --regex -- "(load|set)=" (commandline -pt)' \ | ||||||
| --force-files | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Disable files from being included in completions by default | ||
| complete --command dash-util --no-files | ||
|
|
||
| # Extract options | ||
| function __fish_dash_util_get_options | ||
| set --local cmd (commandline -opc)[1] | ||
| set --local options | ||
|
|
||
| set --append options ($cmd -help 2>&1 | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=') | ||
|
|
||
| for option in $options | ||
| echo $option | ||
| end | ||
| end | ||
|
|
||
| # Extract commands | ||
| function __fish_dash_util_get_commands | ||
| set --local cmd (commandline -opc)[1] | ||
| set --local commands | ||
|
|
||
| set --append commands ($cmd -help | sed -e '1,/Commands:/d' -e 's/=/=\t/' -e 's/(=/=/' -e '/^ [a-z]/ p' -e d | string replace -r '\ \ ' '') | ||
| for command in $commands | ||
| echo $command | ||
| end | ||
| end | ||
|
|
||
| # Add options | ||
| complete \ | ||
| --command dash-util \ | ||
| --condition "not __fish_seen_subcommand_from (__fish_dash_util_get_commands)" \ | ||
| --arguments "(__fish_dash_util_get_options)" | ||
|
|
||
| # Add commands | ||
| complete \ | ||
| --command dash-util \ | ||
| --condition "not __fish_seen_subcommand_from (__fish_dash_util_get_commands)" \ | ||
| --arguments "(__fish_dash_util_get_commands)" | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Disable files from being included in completions by default | ||
| complete --command dash-wallet --no-files | ||
|
|
||
| # Extract options | ||
| function __fish_dash_wallet_get_options | ||
| set --local cmd (commandline -opc)[1] | ||
| for option in ($cmd -help 2>&1 | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=') | ||
| echo $option | ||
| end | ||
| end | ||
|
|
||
| # Extract commands | ||
| function __fish_dash_wallet_get_commands | ||
| set --local cmd (commandline -opc)[1] | ||
| for command in ($cmd -help | sed -e '1,/Commands:/d' -e 's/=/=\t/' -e 's/(=/=/' -e '/^ [a-z]/ p' -e d | string replace -r '\ \ ' '') | ||
| echo $command | ||
| end | ||
| end | ||
|
|
||
| # Add options | ||
| complete \ | ||
| --command dash-wallet \ | ||
| --condition "not __fish_seen_subcommand_from (__fish_dash_wallet_get_commands)" \ | ||
| --arguments "(__fish_dash_wallet_get_options)" | ||
|
|
||
| # Add commands | ||
| complete \ | ||
| --command dash-wallet \ | ||
| --condition "not __fish_seen_subcommand_from (__fish_dash_wallet_get_commands)" \ | ||
| --arguments "(__fish_dash_wallet_get_commands)" | ||
|
|
||
| # Add file completions for load and set commands | ||
| complete --command dash-wallet \ | ||
| --condition "string match -r -- '(dumpfile|datadir)*=' (commandline -pt)" \ | ||
| --force-files | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Disable files from being included in completions by default | ||
| complete --command dashd --no-files | ||
|
|
||
| # Extract options | ||
| function __fish_dashd_get_options | ||
| argparse 'nofiles' -- $argv | ||
| set --local cmd (commandline -opc)[1] | ||
| set --local options | ||
|
|
||
| if set -q _flag_nofiles | ||
| set --append options ($cmd -help-debug | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=' | string match --invert -r '^.*=$') | ||
| else | ||
| set --append options ($cmd -help-debug | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=' | string match -r '^.*=$') | ||
| end | ||
|
|
||
| for option in $options | ||
| echo $option | ||
| end | ||
| end | ||
|
|
||
|
|
||
| # Add options with file completion | ||
| complete \ | ||
| --command dashd \ | ||
| --arguments "(__fish_dashd_get_options)" | ||
| # Enable file completions only if the commandline now contains a `*.=` style option | ||
| complete --command dashd \ | ||
| --condition 'string match --regex -- ".*=" (commandline -pt)' \ | ||
| --force-files | ||
|
|
||
| # Add options without file completion | ||
| complete \ | ||
| --command dashd \ | ||
| --arguments "(__fish_dashd_get_options --nofiles)" | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Low-level changes | ||
| ================= | ||
|
|
||
| RPC | ||
| --- | ||
|
|
||
| - RPC `listsinceblock` now accepts an optional `label` argument | ||
| to fetch incoming transactions having the specified label. (#25934) |
Uh oh!
There was an error while loading. Please reload this page.