summaryrefslogtreecommitdiff
path: root/utils/vyatta-validate-type.c
blob: 57c6e391ce443c916767b1874bfe426869f7632a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "type_check.h"

int
main (int argc, char *argv[])
{
  if (argc < 2) {
    printf("usage: vyatta-validate-type [-q] <type> <value>\n");
    return 1;
  }
  if (strcmp(argv[1], "-q") == 0){
    if (validateType(argv[2], argv[3], 1)) {
      return 0; 
    }
    return 1;
  } 
  if (validateType(argv[1], argv[2], 0)) {
    return 0; 
  }
  return 1;
}