Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

166 rindas
6.6KB

  1. /*===========================================================================
  2. Copyright (c) 1998-2000, The Santa Cruz Operation
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. *Redistributions of source code must retain the above copyright notice,
  7. this list of conditions and the following disclaimer.
  8. *Redistributions in binary form must reproduce the above copyright notice,
  9. this list of conditions and the following disclaimer in the documentation
  10. and/or other materials provided with the distribution.
  11. *Neither name of The Santa Cruz Operation nor the names of its contributors
  12. may be used to endorse or promote products derived from this software
  13. without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
  15. IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT falseT LIMITED TO,
  16. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  17. PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
  18. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  19. CONSEQUENTIAL DAMAGES (INCLUDING, BUT falseT LIMITED TO, PROCUREMENT OF
  20. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  21. INTERRUPTION)
  22. HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  23. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  24. OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  25. DAMAGE.
  26. =========================================================================*/
  27. /* cscope - interactive C symbol cross-reference
  28. *
  29. * display help
  30. *
  31. */
  32. #include "global.h"
  33. #include <ncurses.h>
  34. /*
  35. max num of lines of help screen -
  36. this number needs to be increased if more than n help items are needed
  37. */
  38. const char tooltip_winput[] = "Search [Enter] -Mode [^k] +Mode [^j] Right [Tab] Down [%]";
  39. const char tooltip_wmode[] = "-Mode [Up] +Mode [Down] Right [Tab] Up [%]";
  40. const char tooltip_wresult[] =
  41. "Edit [Enter] Up [Up] Down [Down] Left [Tab] Previous [-] Next [+]";
  42. static char help_msg[] =
  43. "Press the RETURN key repeatedly to move to the desired input field, type the\n"
  44. "pattern to search for, and then press the RETURN key. For the first 4 and\n"
  45. "last 2 input fields, the pattern can be a regcomp(3) regular expression.\n"
  46. "If the search is successful, you can use these single-character commands:\n\n"
  47. "0-9a-zA-Z\tEdit the file containing the displayed line.\n"
  48. "space bar\tDisplay next set of matching lines.\n"
  49. "+\t\tDisplay next set of matching lines.\n"
  50. "^V\t\tDisplay next set of matching lines.\n"
  51. "-\t\tDisplay previous set of matching lines.\n"
  52. "^E\t\tEdit all lines.\n"
  53. ">\t\tWrite the list of lines being displayed to a file.\n"
  54. ">>\t\tAppend the list of lines being displayed to a file.\n"
  55. "<\t\tRead lines from a file.\n"
  56. "^\t\tFilter all lines through a shell command.\n"
  57. "|\t\tPipe all lines to a shell command.\n"
  58. "\nAt any time you can use these single-character commands:\n\n"
  59. "TAB\t\tSwap positions between input and output areas.\n"
  60. "RETURN\t\tMove to the next input field.\n"
  61. "^N\t\tMove to the next input field.\n"
  62. "^P\t\tMove to the previous input field.\n"
  63. "^Y / ^A\t\tSearch with the last pattern typed.\n"
  64. "^B\t\tRecall previous input field and search pattern.\n"
  65. "^F\t\tRecall next input field and search pattern.\n"
  66. "^C\t\tToggle ignore/use letter case when searching.\n"
  67. "^R\t\tRebuild the cross-reference.\n"
  68. "!\t\tStart an interactive shell (type ^D to return).\n"
  69. "^L\t\tRedraw the screen.\n"
  70. "?\t\tDisplay this list of commands.\n"
  71. "^D\t\tExit the program.\n"
  72. "\nNote: If the first character of the pattern you want to search for matches\n"
  73. "a command, type a \\ character first.\n"
  74. "Note: Some ctrl keys may be occupied by your terminal configuration.\n";
  75. static char changeing_help_msg[] =
  76. "When changing text, you can use these single-character commands:\n\n"
  77. "0-9a-zA-Z\tMark or unmark the line to be changed.\n"
  78. "*\t\tMark or unmark all displayed lines to be changed.\n"
  79. "space bar\tDisplay next set of lines.\n"
  80. "+\t\tDisplay next set of lines.\n"
  81. "-\t\tDisplay previous set of lines.\n"
  82. "^A\t\tMark or unmark all lines to be changed.\n"
  83. "^D\t\tChange the marked lines and exit.\n"
  84. "ESC\t\tExit without changing the marked lines.\n"
  85. "!\t\tStart an interactive shell (type ^D to return).\n"
  86. "^L\t\tRedraw the screen.\n"
  87. "?\t\tDisplay this list of commands.\n";
  88. const char *help(void) {
  89. switch (input_mode) {
  90. case INPUT_CHANGE:
  91. case INPUT_CHANGE_TO:
  92. return changeing_help_msg;
  93. default:
  94. return help_msg;
  95. }
  96. }
  97. /* error exit including short usage information */
  98. void error_usage(void) {
  99. usage();
  100. fputs("Try the -h option for more information.\n", stderr);
  101. myexit(1);
  102. }
  103. /* normal usage message */
  104. void usage(void) {
  105. fputs("Usage: " PROGRAM_NAME
  106. " [-bcCdehklLqRTuUvV] [-f file] [-F file] [-i file] [-I dir] [-s dir]\n"
  107. " [-p number] [-P path] [-[0-8] pattern] [source files]\n",
  108. stderr);
  109. }
  110. /* long usage message */
  111. void longusage(void) {
  112. usage();
  113. fprintf(stderr,
  114. "\
  115. \n\
  116. -b Build the cross-reference only.\n\
  117. -C Ignore letter case when searching.\n\
  118. -c Use only ASCII characters in the cross-ref file (don't compress).\n\
  119. -d Do not update the cross-reference.\n\
  120. -e Suppress the <Ctrl>-e command prompt between files.\n\
  121. -F symfile Read symbol reference lines from symfile.\n\
  122. -f reffile Use reffile as cross-ref file name instead of %s.\n",
  123. REFFILE);
  124. fprintf(stderr,
  125. "\
  126. -h This help screen.\n\
  127. -I incdir Look in incdir for any #include files.\n\
  128. -i namefile Browse through files listed in namefile, instead of %s\n",
  129. NAMEFILE);
  130. fprintf(stderr,
  131. "\
  132. -k Kernel Mode - don't use %s for #include files.\n",
  133. DFLT_INCDIR);
  134. fputs("\
  135. -L Do a single search with line-oriented output.\n\
  136. -l Line-oriented interface.\n\
  137. -num pattern Go to input field num (counting from 0) and find pattern.\n\
  138. -P path Prepend path to relative file names in pre-built cross-ref file.\n\
  139. -p n Display the last n file path components.\n\
  140. -q Build an inverted index for quick symbol searching.\n\
  141. -R Recurse directories for files.\n\
  142. -s dir Look in dir for additional source files.\n\
  143. -T Use only the first eight characters to match against C symbols.\n\
  144. -U Check file time stamps.\n\
  145. -u Unconditionally build the cross-reference file.\n\
  146. -v Be more verbose in line mode.\n\
  147. -V Print the version number.\n\
  148. \n\
  149. Please see the manpage for more information.\n",
  150. stderr);
  151. }