Skip to content

Commit

Permalink
fixed bugs with command line options
Browse files Browse the repository at this point in the history
  • Loading branch information
keeferrourke committed May 31, 2017
1 parent f5db058 commit 3b15c01
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyapa/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2"
7 changes: 5 additions & 2 deletions pyapa/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def f_write(filename, matches):
output += m.sprint()
output += '\n'

f_out = open(filename, 'r')
f_out = open(filename, 'w')
f_out.write(output)
f_out.close()

Expand All @@ -56,6 +56,7 @@ def apacheck(text):
def main(argv):
infile = ''
outfile = ''
version = ''

try:
opts, args = getopt.getopt(argv, 'o:i:vh', ['output=', 'input=',
Expand Down Expand Up @@ -88,7 +89,9 @@ def main(argv):
else:
assert False, 'unhandled option'

if not infile:
if not infile and version:
sys.exit(0)
elif not infile and not version:
sys.stderr.write('Error. Input file is required.\n')
print_usage()
sys.exit(2)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.1.1',
version='0.1.2',

description='A Python module for checking APA style in writing',
long_description=long_description,
Expand Down

0 comments on commit 3b15c01

Please sign in to comment.