From 34613383abad9afa5cc1b3945e50bbfca13d036e Mon Sep 17 00:00:00 2001 From: Richard Si <63936253+ichard26@users.noreply.github.com> Date: Tue, 26 May 2020 22:42:07 -0400 Subject: [PATCH] Make 'python -m black' work (#1460) --- README.md | 6 ++++++ src/black/__main__.py | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 src/black/__main__.py diff --git a/README.md b/README.md index 80ef534..b06c937 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,12 @@ To get started right away with sensible defaults: black {source_file_or_directory} ``` +You can run _Black_ as a package if running it as a script doesn't work: + +```sh +python -m black {source_file_or_directory} +``` + ### Command line options _Black_ doesn't provide many options. You can list them by running `black --help`: diff --git a/src/black/__main__.py b/src/black/__main__.py new file mode 100644 index 0000000..19b810b --- /dev/null +++ b/src/black/__main__.py @@ -0,0 +1,3 @@ +from black import patched_main + +patched_main() -- 2.39.2