nebius/SWE-bench-extra huggingface dataset:
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)
```

Comments:

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)',
Repository: nickstenning/honcho

Issue:
Dashes in process types
I believe that process types, according to this [Heroku page](https://devcenter.heroku.com/articles/procfile), must be alphanumeric.

If I create a Procfile with the following content

```
process-type-with-dashes: python -c 'print("hello")'
```

and then run `honcho start`, honcho fails silently.

Also, when I run `honcho check`, it says it is a valid Procfile.

Perhaps it would be helpful if:
- `honcho start` would complain if there is an invalid Procfile
- `honcho check` complains if the process types have dashes

I am using honcho v1.0.1 with python 3.7.0 on macOS.

Thank you for all of your work, I wish I had time to create a PR for this, but I figured creating an issue was better than nothing.

Comments:

Patch:
diff --git a/doc/using_procfiles.rst b/doc/using_procfiles.rst
index 02cd95b..d11dc91 100644
--- a/doc/using_procfiles.rst
+++ b/doc/using_procfiles.rst
@@ -18,10 +18,10 @@ source tree that contains zero or more lines of the form::
 
     <process type>: <command>
 
-The ``process type`` is a string which may contain alphanumerics and underscores
-(``[A-Za-z0-9_]+``), and uniquely identifies one type of process which can be
-run to form your application. For example: ``web``, ``worker``, or
-``my_process_123``.
+The ``process type`` is a string which may contain alphanumerics as well as
+underscores and dashes (``[A-Za-z0-9_-]+``), and uniquely identifies one type
+of process which can be run to form your application. For example: ``web``,
+``worker``, or ``my_process_123``.
 
 ``command`` is a shell commandline which will be executed to spawn a process of
 the specified type.
diff --git a/honcho/environ.py b/honcho/environ.py
index 646d950..09448f3 100644
--- a/honcho/environ.py
+++ b/honcho/environ.py
@@ -13,7 +13,7 @@ if compat.ON_WINDOWS:
     import ctypes
 
 
-PROCFILE_LINE = re.compile(r'^([A-Za-z0-9_]+):\s*(.+)$')
+PROCFILE_LINE = re.compile(r'^([A-Za-z0-9_-]+):\s*(.+)$')
 
 
 class Env(object):


Test patch:
diff --git a/tests/test_environ.py b/tests/test_environ.py
index c7260a4..a9720d7 100644
--- a/tests/test_environ.py
+++ b/tests/test_environ.py
@@ -155,10 +155,17 @@ def test_environ_parse(content, commands):
     [
         # Invalid characters
         """
-        -foo: command
+        +foo: command
         """,
         {}
     ],
+    [
+        # Valid -/_ characters
+        """
+        -foo_bar: command
+        """,
+        {'-foo_bar': 'command'}
+    ],
     [
         # Shell metacharacters
         """