Skip to content

Commit 50671c3

Browse files
committed
Enforced the use of -i
1 parent 1b45d11 commit 50671c3

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

runJSONrun.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ def writeJSON(JSONdata, outputFile):
5050
exit(2)
5151

5252
def usage():
53-
print "\nUsage: runJSONrun.py file.csv ..."
53+
print "\nUsage: runJSONrun.py -i file.csv ..."
5454
print "Convert runmeter (http://www.abvio.com/runmeter/) csv files to JSON."
5555
print ""
5656
print "If you start runJSONrun and only specify a csv file, it will dump the JSON data to standard out."
5757
print ""
5858
print "-?, \t\tPrint this help and exit..."
59-
print "-i, --input\tThe runmeter CSV file to read (needed only if you wan't to write to a file)"
59+
print "-i, --input\tThe runmeter CSV file to read"
6060
print "-o, --output\tThe file you wan't the JSON data to be written to"
6161
print "-V, \t\tPrint the version and exit\n"
6262

@@ -74,13 +74,6 @@ def main():
7474

7575
inputFile = None
7676
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()
8477

8578
for o, a in opts:
8679
if o in ("-i", "--input"):
@@ -95,7 +88,8 @@ def main():
9588
exit()
9689
else:
9790
assert False, "unhandled option " + o
98-
91+
exit(2)
92+
9993
if inputFile != None:
10094

10195
# Parse the CSV file

0 commit comments

Comments
 (0)