#!/usr/bin/env python

import sys

if __name__ == '__main__':
    import codespell_lib
    sys.exit(codespell_lib.main(*sys.argv))

bin/codespell.py
#!/usr/bin/env python

import sys

if __name__ == '__main__':
    import codespell_lib
    sys.exit(codespell_lib.main(*sys.argv[1:]))

bin/codespell.py
diff --git a/bin/codespell.py b/bin/codespell.py
index 0142a97c12..7e4f59f155 100755
--- a/bin/codespell.py
+++ b/bin/codespell.py
@@ -4,4 +4,4 @@
 
 if __name__ == '__main__':
     import codespell_lib
-    sys.exit(codespell_lib.main(*sys.argv))
+    sys.exit(codespell_lib.main(*sys.argv[1:]))
diff --git a/codespell_lib/tests/test_basic.py b/codespell_lib/tests/test_basic.py
index ca4c1f5d6c..05d2fe9693 100644
--- a/codespell_lib/tests/test_basic.py
+++ b/codespell_lib/tests/test_basic.py
@@ -5,6 +5,7 @@
 import contextlib
 import os
 import os.path as op
+import subprocess
 import sys
 import tempfile
 import warnings
@@ -14,6 +15,23 @@
 from codespell_lib import main
 
 
+def run_codespell(args=(), cwd=None):
+    """Helper to run codespell"""
+    return subprocess.Popen(
+        ['codespell.py'] + list(args), cwd=cwd,
+        stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
+
+
+def test_command():
+    """Test running codespell.py"""
+    # With no arguments does "."
+    with TemporaryDirectory() as d:
+        assert_equal(run_codespell(cwd=d), 0)
+        with open(op.join(d, 'bad.txt'), 'w') as f:
+            f.write('abandonned\nAbandonned\nABANDONNED\nAbAnDoNnEd')
+        assert_equal(run_codespell(cwd=d), 4)
+
+
 def test_basic():
     """Test some basic functionality"""
     assert_equal(main('_does_not_exist_'), 0)

codespell.py does nothng if [fileN] is not specified
Previously running `codespell` without file parameter starts the check. Now `codespell.py` does nothing. The behavior should stay the same as before - if file/dir argument is not specefied then current directory should be used as a default parameter.

