home *** CD-ROM | disk | FTP | other *** search
/ Da Capo / da_capo_vol1.bin / programs / amiga / midi / midi_playground / sourcecode / help.c < prev    next >
C/C++ Source or Header  |  1993-01-23  |  2KB  |  75 lines

  1. /**************************************************************************
  2. * help.c:    Functions for giving help to the user.
  3. *        Part of MP, the MIDI Playground.
  4. *
  5. * Author:    Daniel Barrett
  6. * Version:    See the file "version.h".
  7. * Copyright:    None!  This program is in the Public Domain.
  8. *        Please share it with others.
  9. ***************************************************************************/
  10.  
  11.     
  12. #include "mp.h"
  13. #include "version.h"
  14.  
  15.     
  16. /* Print a detailed help message. */
  17.  
  18. void Help(char *progName)
  19. {
  20.     FILE *fp = stderr;
  21.  
  22.     fprintf(fp, "MIDI Playground (%s), version %s, by Daniel Barrett."
  23.             "  100%% Public Domain!\n",
  24.         progName, VERSION);
  25.     fprintf(fp,
  26.        "Usage: %s -%c<FORMAT> -%c<FORMAT> [-%c infile] [-%c outfile]\n",
  27.        progName,
  28.        OPT_INPUT, OPT_OUTPUT, OPT_INFILE, OPT_OUTFILE);
  29.  
  30.     fprintf(fp,
  31.         "The program quits at end-of-file, or when ^C is pressed.\n");
  32.  
  33.     fprintf(fp, "\nThe flags may appear in any order:\n");
  34.     fprintf(fp, "\t-%c\tSpecify the input format.   [MANDATORY]\n",
  35.         OPT_INPUT);
  36.     fprintf(fp, "\t-%c\tSpecify the output format.  [MANDATORY]\n",
  37.         OPT_OUTPUT);
  38.     fprintf(fp, "\t\t\"-%c\" and \"-%c\" must EACH be followed by",
  39.         OPT_INPUT, OPT_OUTPUT);
  40.     fprintf(fp, " exactly one of:\n");
  41.     fprintf(fp, "\t\t\t%c\tText (readable by humans).\n", OPT_TEXT);
  42.     fprintf(fp, "\t\t\t%c\tBinary data (for files).\n", OPT_BINARY);
  43.     fprintf(fp, "\t\t\t%c\tMIDI (using MIDI port).\n", OPT_MIDI);
  44.     fprintf(fp, "\t-%c\tGet data from this file.    [Default=keyboard]\n",
  45.         OPT_INFILE);
  46.     fprintf(fp, "\t-%c\tPut data into this file.    [Default=screen]\n",
  47.         OPT_OUTFILE);
  48.  
  49.     fprintf(fp, "\nExamples:\n");
  50.     fprintf(fp, "\t%s -%c%c -%c%c -%c data\t%s\n",
  51.         progName,
  52.         OPT_INPUT, OPT_MIDI, OPT_OUTPUT, OPT_BINARY,
  53.         OPT_OUTFILE,
  54.         "Read MIDI & put it into binary file \"data\".");
  55.     fprintf(fp,
  56.         "\t%s -%c%c -%c%c\t\tRead typed text, send to MIDI (fun!).\n",
  57.         progName,
  58.         OPT_INPUT, OPT_TEXT, OPT_OUTPUT, OPT_MIDI);
  59.  
  60.     fprintf(fp, "\n\"%s -%c%c\" understands decimal, octal, hex,",
  61.         progName, OPT_INPUT, OPT_TEXT);
  62.     fprintf(fp, " binary, characters, and strings.\n");
  63.     fprintf(fp, "For details, type %c while in \"-%c%c\" mode.\n",
  64.         HELP_SYMBOL, OPT_INPUT, OPT_TEXT);
  65. }
  66.  
  67.     
  68. /* Tell the user how to get more help. */
  69.  
  70. void BegForUsage(char *progName)
  71. {
  72.     fprintf(stderr, "Please type \"%s ?\" for instructions.\n",
  73.         progName);
  74. }
  75.