/* sysdump                                                            */
/* Copyright (C) 1994 IBM Corporation                                 */
/* Copyright (C) 1994 Richard Moore                                   */
/* IBM Internal Use Only                                              */
/* Author: Richard Moore                      Version: 1.0a           */
/* Command Interface to DosForceSystemDump API                        */
/*                                                                    */
/* change log:                                                        */
/* 06/03/94 Created                                                   */
#define INCL_NOPMAPI
#define INCL_DOSMISC
#include <os2.h>

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
APIRET APIENTRY DosForceSystemDump(ULONG reserved);
main(int argc, char *argv[], char *envp[])
{
   APIRET rc;
   int x;

   if (argc>2) {
      printf("Force a Stand-alone System Dump\n");
      printf("Usage: SYSDUMP [/NOPROMPT]\n");
      return 4;
   } /* endif */
   if (argc==2) {
      argv[1]=strupr(argv[1]);
      if (strcmp(argv[1],"/NOPROMPT")==0) {
      rc=DosForceSystemDump(0L);
      } else {
         printf("Force a Stand-alone System Dump\n");
         printf("Usage: SYSDUMP [/NOPROMPT]\n");
        return 4;
      } /* endif */
   } else {
      printf("Do you want to force a system dump? (Y/N)\n");
      x=getc(stdin);
      if (x=='Y' || x=='y') {
         rc=DosForceSystemDump(0L);
      } else {
         return 0;
      } /* endif */
   } /* endif */

   printf("Force a Stand-alone System Dump\n");
   printf("Usage: SYSDUMP [/NOPROMPT]\n");
   return 4;
}
