diff options
author | Timothy Edmund Crosley <timothy.crosley@gmail.com> | 2017-06-07 18:51:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-07 18:51:08 -0700 |
commit | 2e90f65180193b3c4cd96b2d5aea6eccfbe08eba (patch) | |
tree | d3bff46e94139cfeb8916ec1f087a117740e630e | |
parent | d65d97e83e327e6cf0d0ea62ef005140d74b9a15 (diff) | |
parent | 709f84639788e777c2f8bcc4bddc4ba49505ab4a (diff) | |
download | isort-2e90f65180193b3c4cd96b2d5aea6eccfbe08eba.tar.gz |
Merge pull request #570 from timothycrosley/feature/fix-issue-566
Feature/fix issue 566
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rwxr-xr-x | isort/main.py | 2 | ||||
-rw-r--r-- | test_isort.py | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0080a429..ee8501fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Changelog ========= ### 4.3.0 - In progress - Fixed #557: `force_alphabetical_sort` and `force_sort_within_sections` can now be utilized together without extra new lines +- Implemented `--version-number` to retrieve just the version number without the isort logo - Breaking changes - Python 2.7+ only (dropped 2.6) allowing various code simplifications and improvements. diff --git a/isort/main.py b/isort/main.py index fd192338..53bc1d00 100755 --- a/isort/main.py +++ b/isort/main.py @@ -211,6 +211,8 @@ def create_parser(): help="Combines as imports on the same line.") parser.add_argument('-tc', '--trailing-comma', dest='include_trailing_comma', action='store_true', help='Includes a trailing comma on multi line imports that include parentheses.') + parser.add_argument('-vn', '--version-number', action='version', version=__version__, + help='Returns just the current version number without the logo') parser.add_argument('-v', '--version', action='store_true', dest='show_version') parser.add_argument('-vb', '--verbose', action='store_true', dest="verbose", help='Shows verbose output, such as when files are skipped or when a check is successful.') diff --git a/test_isort.py b/test_isort.py index 4cefa8b0..985d135e 100644 --- a/test_isort.py +++ b/test_isort.py @@ -2156,4 +2156,3 @@ def test_long_import_wrap_support_with_mode_2(): test_input = ('from foobar.foobar.foobar.foobar import \\\n' ' an_even_longer_function_name_over_80_characters\n') assert SortImports(file_contents=test_input, multi_line_output=2, line_length=80).output == test_input - |