Skip to content

Commit

Permalink
Code review: 6879043: Adding a default help message to psort and plas…
Browse files Browse the repository at this point in the history
…o_information if no options supplied.
  • Loading branch information
kiddinn committed Dec 3, 2012
1 parent 9dfc4ee commit 504136d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions frontend/log2timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,20 @@

options.recursive = os.path.isdir(options.filename)

format_str = '[%(levelname)s] (%(processName)-10s) %(message)s'
if options.debug:
logging.basicConfig(level=logging.DEBUG, format=format_str)
else:
logging.basicConfig(level=logging.INFO, format=format_str)

if not options.output:
print 'Wrong usage: need to define an output.'
arg_parser.print_help()
logging.error('Wrong usage: need to define an output.')
sys.exit(1)

if options.image_offset or options.image_offset_bytes:
options.image = True

format_str = '[%(levelname)s] (%(processName)-10s) %(message)s'
if options.debug:
logging.basicConfig(level=logging.DEBUG, format=format_str)
else:
logging.basicConfig(level=logging.INFO, format=format_str)

if options.image:
options.preprocess = True

Expand Down
1 change: 1 addition & 0 deletions frontend/plaso_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def DisplayInformation(info, params):
options = arg_parser.parse_args()

if not options.storage_file:
arg_parser.print_help()
logging.error('Not able to run without a storage file being indicated.')
sys.exit(1)

Expand Down
3 changes: 2 additions & 1 deletion frontend/psort.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ def End(self):
sys.exit(0)

if not my_args.protofile:
print '-s STORAGEFILE required! or -h for HELP'
parser.print_help()
logging.error('-s STORAGEFILE required! or -h for HELP')
sys.exit(0)

first, last = GetTimes(my_args)
Expand Down

0 comments on commit 504136d

Please sign in to comment.