Commits

Peter Ward committed a761e79

Added argument parsing.

  • Participants
  • Parent commits 31fb8f0

Comments (0)

Files changed (2)

     entry_points={
         'console_scripts': [
             'shinypress-merge = shinypress.merge',
-            'shinypress-lyrics = shinypress.lyrics',
+            'shinypress-lyrics = shinypress.lyrics:main',
             'shinypress-images = shinypress.images',
         ]
     },

File shinypress/lyrics/__init__.py

         info, verses = parse_lyrics(file)
         return cls(info, verses)
 
+def main(args=None):
+    import argparse
+    parser = argparse.ArgumentParser(
+        description='Convert song lyrics to other formats.',
+    )
+
+    parser.add_argument('lyrics', help='The filename of the song lyrics file.')
+    parser.add_argument('output', help='The filename of the song lyrics file.')
+
+    parser.parse_args(args)
+
+if __name__ == '__main__':
+    import sys
+    main(sys.argv[1:])
+