File tree 2 files changed +20
-3
lines changed
2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 2
2
# Process this file with autoconf to produce a configure script.
3
3
4
4
AC_PREREQ ( [ 2.69] )
5
- AC_INIT ( [ FULL-PACKAGE-NAME] , [ VERSION] , [ BUG-REPORT-ADDRESS] )
6
- AC_CONFIG_SRCDIR ( [ json_parser.y] )
5
+ AC_INIT ( [ jsonval] , [ 0.0.2] , [ https://github.com/dangerousben/jsonval/issues] )
7
6
AC_CONFIG_HEADERS ( [ config.h] )
8
7
9
8
# Checks for programs.
Original file line number Diff line number Diff line change 20
20
#include <stdio.h>
21
21
#include <stdlib.h>
22
22
#include <getopt.h>
23
+ #include "config.h"
23
24
#include "json_parser.h"
24
25
#include "json_scanner.h"
25
26
@@ -28,13 +29,30 @@ unsigned char parse_and_report(const char *);
28
29
29
30
int xml_output = 0 ;
30
31
32
+ void usage () {
33
+ printf ("Usage: %s [options] [/path/to/file]\n" , PACKAGE );
34
+ printf ("\t\t(if file is not specified or -, read from stdin)\n" );
35
+ printf ("\nOPTIONS:\n" );
36
+ printf ("-x\t\tOutput in jslint-esque XML\n" );
37
+ printf ("-h\t\tShow this help\n" );
38
+ printf ("-v\t\tShow version number\n" );
39
+ exit (0 );
40
+ }
41
+
31
42
int main (int argc , char * argv [])
32
43
{
33
44
unsigned char err = 0 ;
34
45
int c ;
35
46
36
- while ((c = getopt (argc , argv , "x " )) != -1 ) {
47
+ while ((c = getopt (argc , argv , "hvx " )) != -1 ) {
37
48
switch (c ) {
49
+ case 'h' :
50
+ usage ();
51
+ break ;
52
+ case 'v' :
53
+ printf ("%s %s\n" , PACKAGE , PACKAGE_VERSION );
54
+ exit (0 );
55
+ break ;
38
56
case 'x' :
39
57
xml_output = 1 ;
40
58
break ;
You can’t perform that action at this time.
0 commit comments