Skip to content

Commit

Permalink
fix help for utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
jehiah committed Oct 21, 2010
1 parent 5c0abaa commit 31c8fa1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.markdown
Expand Up @@ -9,6 +9,8 @@ Installing form github `pip install -e git://github.com/bitly/data_hacks.git#egg


Installing from source `python setup.py install` Installing from source `python setup.py install`


data_hacks are friendly. Ask them for usage information with `--help`

histogram.py histogram.py
------------ ------------


Expand Down
4 changes: 2 additions & 2 deletions data_hacks/nintey_five_percent.py
Expand Up @@ -56,7 +56,7 @@ def calc_95(data, count):
return t return t


if __name__ == "__main__": if __name__ == "__main__":
if sys.stdin.isatty(): if sys.stdin.isatty() or '--help' in sys.argv or '-h' in sys.argv:
print "Usage: cat data | %(prog)s" % os.path.basename(sys.argv[0]) print "Usage: cat data | %s" % os.path.basename(sys.argv[0])
sys.exit(1) sys.exit(1)
run() run()
4 changes: 2 additions & 2 deletions data_hacks/run_for.py
Expand Up @@ -51,8 +51,8 @@ def run(runtime):
return return


if __name__ == "__main__": if __name__ == "__main__":
usage = "Usage: tail -f access.log | %(prog)s [time] | ..." % os.path.basename(sys.argv[0]) usage = "Usage: tail -f access.log | %s [time] | ..." % os.path.basename(sys.argv[0])
help = "time can be in the format 10s 10m 10h etc" help = "time can be in the format 10s, 10m, 10h, etc"
if sys.stdin.isatty(): if sys.stdin.isatty():
print usage print usage
print help print help
Expand Down

0 comments on commit 31c8fa1

Please sign in to comment.