putoptv.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*====================================================================*
  2. *
  3. * void putoptv(char const *help[]);
  4. *
  5. * putoptv.h
  6. *
  7. * print program information on stdout; informtion is stored as an
  8. * ordered string vector; string indexes are defined in getopt.h;
  9. *
  10. * Motley Tools by Charles Maier;
  11. * Copyright (c) 2001-2006 by Charles Maier Associates;
  12. * Licensed under the Internet Software Consortium License;
  13. *
  14. *--------------------------------------------------------------------*/
  15. #ifndef PUTOPTV_SOURCE
  16. #define PUTOPTV_SOURCE
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include "../tools/getoptv.h"
  20. #include "../tools/putoptv.h"
  21. void putoptv (char const * optv [])
  22. {
  23. extern char const * program_name;
  24. size_t index;
  25. printf ("\n");
  26. printf (" program: %s\n\n", optv [PUTOPTV_I_PROGRAM]);
  27. printf (" command: %s [options] %s\n\n", program_name, optv [PUTOPTV_I_COMMAND]);
  28. printf (" options: [%s%c%c]\n\n", optv [PUTOPTV_I_OPTIONS], GETOPTV_C_VERSION, GETOPTV_C_SUMMARY);
  29. for (index = PUTOPTV_I_DETAILS; optv [index] != (char *) (0); index++)
  30. {
  31. printf (" %c%s\n", GETOPTV_C_OPTION, optv [index]);
  32. }
  33. printf (" %c%c\tversion information\n", GETOPTV_C_OPTION, GETOPTV_C_VERSION);
  34. printf (" %c%c\thelp summary\n", GETOPTV_C_OPTION, GETOPTV_C_SUMMARY);
  35. printf ("\n");
  36. return;
  37. }
  38. #endif