diff --git a/README.md b/README.md index 53d6285d0481809b173ddd6b9456583e1ea87a30..5c845008d5251057d597eef11dc3e9fba35d157d 100644 --- a/README.md +++ b/README.md @@ -50,19 +50,22 @@ ``` ### Interactive Commands -| Key | Action | -| :-- | :---------------------------------------------------------------- | -| `r` | **Run** the program (auto-breaks on `main` if no breakpoints set) | -| `b` | Add a **breakpoint** (enter name/file:line) | -| `p` | **Print** variable value | -| `n` | **Step over** | -| `s` | **Step into** | -| `o` | **Step out** | -| `c` | **Continue** execution | -| `w` | **Watch** expression | -| `q` | **Quit** debugger | -| `>` | **Reduces sidebar width** | -| `<` | **Increases sidebar width** | +| Key | Action | +| :----------- | :---------------------------------------------------------------- | +| `r` | **Run** the program (auto-breaks on `main` if no breakpoints set) | +| `b` | Add a **breakpoint** (enter name/file:line) | +| `p` | **Print** variable value | +| `n` | **Step over** | +| `s` | **Step into** | +| `o` | **Step out** | +| `c` | **Continue** execution | +| `w` | **Watch** expression | +| `h` | **Toggle help view** | +| `Ctrl+Left` | **Increases sidebar width** | +| `Ctrl+Right` | **Reduces sidebar width** | +| `Ctrl+Up` | **Increases log height** | +| `Ctrl+Down` | **Reduces log height** | +| `q` | **Quit** debugger | ### Input Mode diff --git a/tdbg.cpp b/tdbg.cpp index 3daede15ecfe4d250d47b8387d3c9618afdb60f9..b078f0a23f2fa8e4138960ef0e0fc9cd22894016 100644 --- a/tdbg.cpp +++ b/tdbg.cpp @@ -771,6 +771,14 @@ } else if (arg == "-b" && i + 1 < argc) { startup_breakpoints.push_back(argv[++i]); } else if (arg == "-run") { auto_run = true; + } else if (arg == "-h" || arg == "--help") { + std::cout << "Usage: " << argv[0] << " [options] [-- arg1 arg2 ...]\n\n" + << "Options:\n" + << " -e KEY=VALUE Set environment variable\n" + << " -b BREAKPOINT Set startup breakpoint (name or file:line)\n" + << " -run Automatically run the target on startup\n" + << " -h, --help Show this help message\n"; + return 0; } else if (arg == "--") { for (int j = i + 1; j < argc; ++j) { debuggee_args.push_back(argv[j]);