Permalink
Browse files

fix help for utilities

  • Loading branch information...
1 parent 5c0abaa commit 31c8fa11a07706c3922f5b71b3e7ef9d64fc7200 @jehiah jehiah committed Oct 21, 2010
Showing with 6 additions and 4 deletions.
  1. +2 −0 README.markdown
  2. +2 −2 data_hacks/nintey_five_percent.py
  3. +2 −2 data_hacks/run_for.py
View
2 README.markdown
@@ -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`
+data_hacks are friendly. Ask them for usage information with `--help`
+
histogram.py
------------
View
4 data_hacks/nintey_five_percent.py
@@ -56,7 +56,7 @@ def calc_95(data, count):
return t
if __name__ == "__main__":
- if sys.stdin.isatty():
- print "Usage: cat data | %(prog)s" % os.path.basename(sys.argv[0])
+ if sys.stdin.isatty() or '--help' in sys.argv or '-h' in sys.argv:
+ print "Usage: cat data | %s" % os.path.basename(sys.argv[0])
sys.exit(1)
run()
View
4 data_hacks/run_for.py
@@ -51,8 +51,8 @@ def run(runtime):
return
if __name__ == "__main__":
- usage = "Usage: tail -f access.log | %(prog)s [time] | ..." % os.path.basename(sys.argv[0])
- help = "time can be in the format 10s 10m 10h etc"
+ 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"
if sys.stdin.isatty():
print usage
print help

0 comments on commit 31c8fa1

Please sign in to comment.