]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
error check argument passed into epgdump
authorAndrew C. Martin <andrewcmartin@msn.com>
Fri, 8 Mar 2013 03:23:14 +0000 (20:23 -0700)
committerAndrew C. Martin <andrewcmartin@msn.com>
Fri, 8 Mar 2013 03:45:01 +0000 (20:45 -0700)
support/epgdump

index 1c440db5807067f63a5fb4222108542073c2a3cd..d0db4a30bd5f136605c2f7658ca860e9bef19027 100755 (executable)
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 """
-Dump EPG in human readable format for analysis
+Dump Electronic Program Guide (EPG) in human readable format for analysis
 """
 
 # System libs
@@ -26,6 +26,12 @@ import pprint
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib', 'py'))
 import tvh.htsmsg as htsmsg
 
+if len(sys.argv) < 2:
+  sys.exit('Usage: %s epg-path' % sys.argv[0])
+
+if not os.path.exists(sys.argv[1]):
+  sys.exit('ERROR: epg "%s" was not found!' % sys.argv[1])
+
 # Open file
 fp = open(sys.argv[1], 'rb')
 for msg in htsmsg.deserialize(fp, True):