StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MyPackageMain.cxx
1 // $Id: MyPackageMain.cxx,v 1.1 2009/11/24 19:02:50 fine Exp $
2 //*-- Author : Valery Fine(fine@bnl.gov) 24/11/2009
3 #ifndef STAR_MYPACKAGEMAIN
4 #define STAR_MYPACKAGEMAIN
5 #include <stdlib.h>
6 #include <stdio.h>
7 
8 void usage(const char *name) {
9  printf( "\n\nUsage: %s [input_file [ output_file]]\n",name);
10  printf( "-----\n");
11 }
12 
13 int main(int argc, char * argv[])
14 {
15  const char *packageName="No_name";
16  printf("Hello World %d: \n", argc);
17  switch (argc) {
18  case 3: printf("\tThe output file name <%s>\n", argv[2]);
19  case 2: printf("\tThe input file name <%s>\n", argv[1]);
20  case 1: printf("\tThe package name <%s>", argv[0]);
21  packageName = argv[0];
22  break;
23  default:
24  printf("\tNo paramater\n");
25  break;
26  }
27  usage(packageName);
28  return 0;
29 }
30 
31 #endif