File tree 1 file changed +4
-10
lines changed
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,13 @@ def writeJSON(JSONdata, outputFile):
50
50
exit (2 )
51
51
52
52
def usage ():
53
- print "\n Usage: runJSONrun.py file.csv ..."
53
+ print "\n Usage: runJSONrun.py -i file.csv ..."
54
54
print "Convert runmeter (http://www.abvio.com/runmeter/) csv files to JSON."
55
55
print ""
56
56
print "If you start runJSONrun and only specify a csv file, it will dump the JSON data to standard out."
57
57
print ""
58
58
print "-?, \t \t Print this help and exit..."
59
- print "-i, --input\t The runmeter CSV file to read (needed only if you wan't to write to a file) "
59
+ print "-i, --input\t The runmeter CSV file to read"
60
60
print "-o, --output\t The file you wan't the JSON data to be written to"
61
61
print "-V, \t \t Print the version and exit\n "
62
62
@@ -74,13 +74,6 @@ def main():
74
74
75
75
inputFile = None
76
76
outputFile = None
77
-
78
- # If we only have one argument, we assume it's the csv file
79
- if len (argv ) == 2 :
80
- inputFile = argv [1 ]
81
- elif len (argv ) == 1 :
82
- usage ()
83
- exit ()
84
77
85
78
for o , a in opts :
86
79
if o in ("-i" , "--input" ):
@@ -95,7 +88,8 @@ def main():
95
88
exit ()
96
89
else :
97
90
assert False , "unhandled option " + o
98
-
91
+ exit (2 )
92
+
99
93
if inputFile != None :
100
94
101
95
# Parse the CSV file
You can’t perform that action at this time.
0 commit comments