diff options
Diffstat (limited to 'src/main_gui.cpp')
| -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 | } |