File tree Expand file tree Collapse file tree 4 files changed +37
-12
lines changed Expand file tree Collapse file tree 4 files changed +37
-12
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,5 @@ lc daily py -e vim
5858
5959#### Todo
6060
61- - [ ] Implement test case management
6261- [ ] Add support for custom test cases
63- - [ ] Improve error handling
6462- [ ] Add solution templates
Original file line number Diff line number Diff line change 1- from setuptools import setup , find_packages
1+ from setuptools import find_packages , setup
22
33setup (
44 name = "leetcode-cli" ,
55 version = "0.1.0" ,
66 packages = find_packages (),
7- install_requires = [
8- "typer" ,
9- "requests" ,
10- "gql[all]"
11- ],
127 entry_points = {
138 "console_scripts" : [
14- "lc=src.main:app " ,
9+ "lc=src.main:main " ,
1510 ],
16- }
17- )
11+ },
12+ )
Original file line number Diff line number Diff line change 1+ import typer
2+ from rich .console import Console
3+
4+ console = Console ()
5+
6+
7+ def get_leetcode_ascii ():
8+ """Return LeetCode ASCII art"""
9+ return """
10+ | _ _ |- _ | _
11+ |_(/_(/_|_(_()(|(/_
12+ """
13+
14+
15+ def display_welcome (app : typer .Typer ):
16+ """Display welcome screen with ASCII art and command list"""
17+ console .print (get_leetcode_ascii ())
18+ console .print (" Welcome to LeetCode CLI" , style = "bold" )
Original file line number Diff line number Diff line change 99from src .commands .solution import solutions
1010from src .commands .submit import submit
1111from src .commands .test import test
12+ from src .lib .welcome import display_welcome
1213
1314app = typer .Typer ()
1415
2324app .command (name = "edit" )(edit )
2425app .command (name = "solutions" )(solutions )
2526
26- if __name__ == "__main__" :
27+
28+ @app .callback (invoke_without_command = True )
29+ def callback (ctx : typer .Context ):
30+ """LeetCode CLI - A command-line tool for LeetCode problems."""
31+ if ctx .invoked_subcommand is None :
32+ display_welcome (app )
33+ typer .echo (ctx .get_help ())
34+
35+
36+ def main ():
2737 app ()
38+
39+
40+ if __name__ == "__main__" :
41+ main ()
You can’t perform that action at this time.
0 commit comments