Skip to content

Commit

Permalink
change print, change no argument behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
astrowonk committed Jul 28, 2021
1 parent fcb49dc commit 1f937b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gpxcsv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _list_to_csv(self, list_of_dicts, csv_file):
for row in list_of_dicts:
mywriter.writerow(row)
self._check_verbose_print(
f"CSV {csv_file} written with {len(list_of_dicts)} rows",
f"CSV {csv_file} written to {csv_file} with {len(list_of_dicts)} rows",
force=True)
if self.verbose:
#leaving this in an if statement because of the column formatting for now
Expand Down
11 changes: 10 additions & 1 deletion gpxcsv/__main__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import glob
import argparse
import sys

from . import GpxCSV


class MyParser(argparse.ArgumentParser):
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
sys.exit(2)


def main():
"""Main function for command line utility"""
parser = argparse.ArgumentParser()
parser = MyParser()
parser.add_argument(
'input_file',
nargs='+',
Expand Down

0 comments on commit 1f937b4

Please sign in to comment.