Repository: nickstenning/honcho

Issue:
-f argument before command is suppressed
System information: Mac OS X, 10.11.1
Honcho version: 0.7.0

With the latest release of honcho (0.7.0), I've noticed that the -f argument is processed properly **after** a command, but not **before** a command.  -e and -d arguments don't exhibit this order-dependent behavior.

Examples:
```
$ honcho -f my_procfile check
2016-04-12 23:49:22 [45546] [ERROR] Procfile does not exist or is not a file
$ honcho check -f my_procfile
2016-04-12 23:49:24 [45548] [INFO] Valid procfile detected (postgres, rabbit, redis, flower)
```

Discussion:

Patch:
diff --git a/honcho/command.py b/honcho/command.py
index 3796a39..9a7323d 100644
--- a/honcho/command.py
+++ b/honcho/command.py
@@ -39,6 +39,7 @@ def _add_common_args(parser, with_defaults=False):
                         help='procfile directory (default: .)')
     parser.add_argument('-f', '--procfile',
                         metavar='FILE',
+                        default=suppress,
                         help='procfile path (default: Procfile)')
     parser.add_argument('-v', '--version',
                         action='version',


Test patch:
diff --git a/tests/integration/test_start.py b/tests/integration/test_start.py
index 2388bda..73c8693 100644
--- a/tests/integration/test_start.py
+++ b/tests/integration/test_start.py
@@ -53,6 +53,39 @@ def test_start_env_procfile(testenv):
     assert 'mongoose' in out
 
 
+@pytest.mark.parametrize('testenv', [{
+    'Procfile': 'foo: {0} test.py'.format(python_bin),
+    'Procfile.dev': 'bar: {0} test_dev.py'.format(python_bin),
+    'test.py': script,
+    'test_dev.py': textwrap.dedent("""
+        from __future__ import print_function
+        print("mongoose")
+        """)
+}], indirect=True)
+def test_start_procfile_after_command(testenv):
+    # Regression test for #173: Ensure that -f argument can be provided after
+    # command
+    ret, out, err = testenv.run_honcho(['start', '-f', 'Procfile.dev'])
+
+    assert 'mongoose' in out
+
+
+@pytest.mark.parametrize('testenv', [{
+    'Procfile': 'foo: {0} test.py'.format(python_bin),
+    'Procfile.dev': 'bar: {0} test_dev.py'.format(python_bin),
+    'test.py': script,
+    'test_dev.py': textwrap.dedent("""
+        from __future__ import print_function
+        print("mongoose")
+        """)
+}], indirect=True)
+def test_start_procfile_before_command(testenv):
+    # Test case for #173: Ensure that -f argument can be provided before command
+    ret, out, err = testenv.run_honcho(['-f', 'Procfile.dev', 'start'])
+
+    assert 'mongoose' in out
+
+
 @pytest.mark.parametrize('testenv', [{
     'Procfile': 'foo: {0} test.py'.format(python_bin),
     'test.py': 'import sys; sys.exit(42)',