diff options
| author | Bitflash <btf01@proton.me> | 2026-08-01 22:19:34 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-01 22:19:34 -0300 |
| commit | e9b3c1734aa274f801b4ffe7cfbc54d4c455f8e5 (patch) | |
| tree | 6ca4184e417affe0e1f8a4dcec30fc4f13f63eb6 /src | |
| parent | a45ed6918bc69c938e86e7107a038fd830a1cfde (diff) | |
docs: bring the README up to the wallet that exists, and make -help print (#106)
The README still said deterministic restore was an open issue, told people the mining mode was not remembered between restarts, and wrote every flag in the slash form that MSYS2 turns into a path before the node sees it. Rewritten around the phrase and the file as two backups covering different keys, the -restorephrase note for anyone who made a phrase on 1.2.12, -rescan, the diagnostics report, and the two upgrade reasons measured this week.
Also: -help printed nothing at all. This tree remaps printf to OutputDebugStringF, so the usage page went into debug.log, and a -mwindows binary has no console to write to either way -- the one command whose job is to tell you something returned 0 and said nothing. It now takes the real printf and attaches the terminal. The help text was missing -restoredepth, -showderived and the wallet-hd self-test.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main_gui.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp index c9e7dee..32fcdef 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp | |||
| @@ -40,6 +40,12 @@ static string argval2(int argc, char* argv[], const char* keySlash, const char* | |||
| 40 | return argval(argc, argv, keyDash); | 40 | return argval(argc, argv, keyDash); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | // The real printf, not the one util.h remaps to OutputDebugStringF. Help that | ||
| 44 | // goes to debug.log is help nobody asked for: `-help` printed a full page into | ||
| 45 | // the data directory and returned 0 with an empty terminal, which reads as a | ||
| 46 | // command that does nothing. Same reason walletcmd.cpp undefines it. | ||
| 47 | #undef printf | ||
| 48 | |||
| 43 | static void PrintUsage() | 49 | static void PrintUsage() |
| 44 | { | 50 | { |
| 45 | printf("Bitflash command-line options\n"); | 51 | printf("Bitflash command-line options\n"); |
| @@ -50,7 +56,7 @@ static void PrintUsage() | |||
| 50 | printf(" /debug\n"); | 56 | printf(" /debug\n"); |
| 51 | printf(" /gen\n"); | 57 | printf(" /gen\n"); |
| 52 | printf(" /nogui or /daemon\n"); | 58 | printf(" /nogui or /daemon\n"); |
| 53 | printf(" /selftest=wallet-keypool\n"); | 59 | printf(" /selftest=wallet-keypool or /selftest=wallet-hd\n"); |
| 54 | printf("\n"); | 60 | printf("\n"); |
| 55 | printf("Mining mode:\n"); | 61 | printf("Mining mode:\n"); |
| 56 | printf(" /operator\n"); | 62 | printf(" /operator\n"); |
| @@ -84,12 +90,18 @@ static void PrintUsage() | |||
| 84 | printf(" wallet that has none, show it once, exit)\n"); | 90 | printf(" wallet that has none, show it once, exit)\n"); |
| 85 | printf(" /restorephrase=\"WORDS\" (rebuild this wallet from a phrase and scan\n"); | 91 | printf(" /restorephrase=\"WORDS\" (rebuild this wallet from a phrase and scan\n"); |
| 86 | printf(" the chain for its coins, then exit)\n"); | 92 | printf(" the chain for its coins, then exit)\n"); |
| 93 | printf(" /restoredepth=N (with /restorephrase: derive at least N\n"); | ||
| 94 | printf(" addresses before giving up)\n"); | ||
| 95 | printf(" /showderived=N (list the first N addresses a phrase\n"); | ||
| 96 | printf(" produces, without installing it)\n"); | ||
| 87 | printf(" /rescan (walk the chain for coins this wallet owns\n"); | 97 | printf(" /rescan (walk the chain for coins this wallet owns\n"); |
| 88 | printf(" but never recorded, then exit)\n"); | 98 | printf(" but never recorded, then exit)\n"); |
| 89 | printf("\n"); | 99 | printf("\n"); |
| 90 | printf("Each option also accepts '-' instead of '/'.\n"); | 100 | printf("Each option also accepts '-' instead of '/'.\n"); |
| 91 | } | 101 | } |
| 92 | 102 | ||
| 103 | #define printf OutputDebugStringF | ||
| 104 | |||
| 93 | static void ParseStartupArguments(int argc, char* argv[]) | 105 | static void ParseStartupArguments(int argc, char* argv[]) |
| 94 | { | 106 | { |
| 95 | if (arg(argc,argv,"/datadir") || arg(argc,argv,"-datadir")) | 107 | if (arg(argc,argv,"/datadir") || arg(argc,argv,"-datadir")) |
| @@ -221,6 +233,11 @@ int main(int argc, char* argv[]) | |||
| 221 | if (arg(argc,argv,"/help") || arg(argc,argv,"-help") || | 233 | if (arg(argc,argv,"/help") || arg(argc,argv,"-help") || |
| 222 | arg(argc,argv,"--help") || arg(argc,argv,"/?")) | 234 | arg(argc,argv,"--help") || arg(argc,argv,"/?")) |
| 223 | { | 235 | { |
| 236 | // Without this the help prints into nothing. A -mwindows binary starts | ||
| 237 | // with no console, so every one of those printfs went nowhere and the | ||
| 238 | // one command whose entire job is to tell you something told you | ||
| 239 | // nothing at all -- exit code 0, not a byte of output. | ||
| 240 | AttachTerminal(); | ||
| 224 | PrintUsage(); | 241 | PrintUsage(); |
| 225 | return 0; | 242 | return 0; |
| 226 | } | 243 | } |