Skip to content

Commit a5dc4e1

Browse files
committed
update README & add version option
1 parent 63aa58c commit a5dc4e1

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# LeetCode Project Generator
22

3+
## Practice LeetCode Locally with Ease
4+
5+
LPG is a powerful tool that facilitates the generation of local solution and test files for LeetCode problems. Say goodbye to the web-based runner and hello to seamless local development. With LPG, you can write, test, and refine your solutions in the comfort of your own environment.
36
A CLI tool created using [Click](https://click.palletsprojects.com/en/8.1.x/).
4-
This utility creates a barebones project template from the URL of a LeetCode problem.
57

68
## Installation
79

@@ -16,11 +18,14 @@ pip install leetcode-project-generator
1618
```sh
1719
python -m pip install setuptools, build
1820
python -m build
19-
python -m pip install ./dist/lpg-*-py3-none-any.whl
21+
python -m pip install ./dist/leetcode_project_generator-*-py3-none-any.whl
2022
```
2123

2224
## Usage
2325

26+
> [!TIP]
27+
> LPG allows you to generate the project files for a given problem by just copy and pasting the URL from LeetCode!
28+
2429
### Installed package
2530

2631
```sh
@@ -38,7 +43,7 @@ python -m lpg (--title_slug <problem title> | --url <problem url>) [--directory
3843
"Title slug" refers to the dashed title of the LeetCode problem which can be found in the URL of the problem.
3944
E.g. for <https://leetcode.com/problems/two-sum/description/>, the title slug is `two-sum`.
4045

41-
The default language is C. Other languages are currently unsupported.
46+
The default language is C. For an updated list of supported languages, refer to [the roadmap](https://github.com/kguzek/leetcode-project-generator#roadmap) or [the related issue](https://github.com/kguzek/leetcode-project-generator/issues/1).
4247
If using Bash, you must surround the URL with quotes, since the `&` symbol would be interpreted as an asynchronous command.
4348

4449
The project directory defaults to `~/Documents/Coding/{language_name}/`. You may use use the template `{language_name}` when specifying the directory, and this will automatically be translated into the name of the language specified using `--lang`. E.g.: `cpp -> C++`.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "leetcode-project-generator"
9-
version = "1.5.1"
9+
version = "1.5.2"
1010
authors = [
1111
{ name = "Konrad Guzek", email = "[email protected]" },
1212
]

src/lpg/lpg.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import click
1111

12+
from .interfaces.file import LANGUAGE_INTERFACES, create_project
1213
from .interfaces.web import get_leetcode_template, is_title_slug
13-
from .interfaces.file import create_project, LANGUAGE_INTERFACES
1414

1515
DEFAULT_PROJECT_LANGUAGE = "c"
1616
DEFAULT_PROJECT_DIRECTORY = R"~/Documents/Coding/{language_name}/leetcode/"
@@ -77,6 +77,13 @@
7777
show_default=True,
7878
)
7979
@click.help_option("--help", "-h")
80+
@click.version_option(
81+
None,
82+
"--version",
83+
"-v",
84+
package_name="leetcode-project-generator",
85+
message="LeetCode Project Generator version %(version)s by Konrad Guzek",
86+
)
8087
@click.argument("url_or_slug", required=False)
8188
def lpg( # pylint: disable=too-many-arguments, too-many-positional-arguments
8289
url_or_slug: str | None = None,

0 commit comments

Comments
 (0)