diff --git a/iwla.py b/iwla.py index 81571be..42f5f2c 100755 --- a/iwla.py +++ b/iwla.py @@ -623,6 +623,9 @@ if __name__ == '__main__': default=False, help='Read data from stdin instead of conf.analyzed_filename') + parser.add_argument('-f', '--file', dest='file', + help='Analyse this log file') + args = parser.parse_args() if args.clean_output: @@ -638,8 +641,9 @@ if __name__ == '__main__': if args.stdin: iwla.start(sys.stdin) else: - if not os.path.exists(conf.analyzed_filename): - print 'No such file \'%s\'' % (conf.analyzed_filename) + filename = args.file or conf.analyzed_filename + if not os.path.exists(filename): + print 'No such file \'%s\'' % (filename) sys.exit(-1) - with open(conf.analyzed_filename) as f: + with open(filename) as f: iwla.start(f)