From: Richard Si <63936253+ichard26@users.noreply.github.com> Date: Wed, 27 May 2020 02:42:07 +0000 (-0400) Subject: Make 'python -m black' work (#1460) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/34613383abad9afa5cc1b3945e50bbfca13d036e Make 'python -m black' work (#1460) --- 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()