diff options
Diffstat (limited to 'utils/vyatta-validate-type.c')
-rw-r--r-- | utils/vyatta-validate-type.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/vyatta-validate-type.c b/utils/vyatta-validate-type.c new file mode 100644 index 0000000..57c6e39 --- /dev/null +++ b/utils/vyatta-validate-type.c @@ -0,0 +1,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; +} |