Repository: cevoaustralia/aws-google-auth

Issue:
main() takes exactly 1 argument (0 given)
I'm getting the following error, introduced in 48d22e4d62bb6e216cd8932739ea0be4735e2588 (Determined by `git bisect`). I don't have the time to dig right now, but I will later.

```
$ aws-google-auth --help 
Traceback (most recent call last):
  File "/Users/mide/virtualenv/aws-google-auth-dev/bin/aws-google-auth", line 11, in <module>
    load_entry_point('aws-google-auth', 'console_scripts', 'aws-google-auth')()
TypeError: main() takes exactly 1 argument (0 given)
```

Discussion:

Patch:
diff --git a/aws_google_auth/__init__.py b/aws_google_auth/__init__.py
index 0ec8126..2163356 100644
--- a/aws_google_auth/__init__.py
+++ b/aws_google_auth/__init__.py
@@ -51,7 +51,7 @@ def exit_if_unsupported_python():
         sys.exit(1)
 
 
-def main(cli_args):
+def cli(cli_args):
     try:
         exit_if_unsupported_python()
 
@@ -201,6 +201,10 @@ def process_auth(args, config):
         amazon_client.print_export_line()
 
 
-if __name__ == '__main__':
+def main():
     cli_args = sys.argv[1:]
-    main(cli_args)
+    cli(cli_args)
+
+
+if __name__ == '__main__':
+    main()


Test patch:
diff --git a/aws_google_auth/tests/test_init.py b/aws_google_auth/tests/test_init.py
index 9a298a8..cd818d2 100644
--- a/aws_google_auth/tests/test_init.py
+++ b/aws_google_auth/tests/test_init.py
@@ -11,6 +11,20 @@ class TestInit(unittest.TestCase):
     def setUp(self):
         pass
 
+    @patch('aws_google_auth.cli', spec=True)
+    def test_main_method_has_no_parameters(self, mock_cli):
+        """
+        This is the entrypoint for the cli tool, and should require no parameters
+
+        :param mock_cli:
+        :return:
+        """
+
+        # Function under test
+        aws_google_auth.main()
+
+        self.assertTrue(mock_cli.called)
+
     @patch('aws_google_auth.exit_if_unsupported_python', spec=True)
     @patch('aws_google_auth.resolve_config', spec=True)
     @patch('aws_google_auth.process_auth', spec=True)
@@ -22,7 +36,7 @@ class TestInit(unittest.TestCase):
         aws_google_auth.resolve_config.return_value = mock_config
 
         # Function under test
-        aws_google_auth.main([])
+        aws_google_auth.cli([])
 
         self.assertTrue(exit_if_unsupported_python.called)
         self.assertTrue(resolve_config.called)