summaryrefslogtreecommitdiffstats
path: root/Tests/CustomCommand/check_command_line.c.in
blob: a4dbe22d201581b648b45b2f91d9f7c93ac5128c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>

const char* expected_arguments[] =
{
@EXPECTED_ARGUMENTS@  0
};

int main(int argc, const char* argv[])
{
  const char** a = argv+1;
  const char** e = expected_arguments;
  (void)argc;
  for(;*a && *e; ++a, ++e)
    {
    if(strcmp(*a, *e) != 0)
      {
      fprintf(stderr, "Argument [%s] does not match expected [%s].\n",
              *a, *e);
      return 1;
      }
    else
      {
      printf("[%s]\n", *a);
      }
    }
  if(*a || *e)
    {
    fprintf(stderr, "Number of arguments does not match expected.\n");
    return 1;
    }
  return 0;
}