File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818import typing as t
1919
2020import rich_click as click
21- from rich .console import Console
2221from rich .pretty import pprint
2322from rich .syntax import Syntax
2423
2524from . import License
2625from .__lib import (
2726 __pkg__ ,
2827 __version__ ,
28+ console ,
2929 update_window_title ,
3030 clear_screen ,
3131 print_jsonp ,
3232 print_panels ,
3333)
3434from .api import Searchcode
3535
36- sc = Searchcode (user_agent = f"{ __pkg__ } -sdk/cli" )
37-
3836__all__ = ["cli" ]
39-
40- console = Console (highlight = True )
37+ sc = Searchcode (user_agent = f"{ __pkg__ } -sdk/cli" )
4138
4239
4340@click .group ()
@@ -139,9 +136,7 @@ def search(
139136 clear_screen ()
140137 update_window_title (text = query )
141138
142- with console .status (
143- f"Querying code index with search string: [green]{ query } [/]..."
144- ):
139+ with console .status (f"Querying code index: [green]{ query } [/]" ):
145140 languages = languages .split ("," ) if languages else None
146141 sources = sources .split ("," ) if sources else None
147142
@@ -156,10 +151,6 @@ def search(
156151 callback = callback ,
157152 )
158153
159- console .print (
160- f"🗸 Showing { len (response .results )} of { per_page } results for '{ query } '"
161- )
162-
163154 (
164155 print_jsonp (jsonp = response )
165156 if callback
@@ -177,7 +168,7 @@ def code(id: int):
177168 """
178169 clear_screen ()
179170 update_window_title (text = str (id ))
180- with console .status (f"Fetching data for code file with ID : [cyan]{ id } [/]... " ):
171+ with console .status (f"Fetching code file: [cyan]{ id } [/]" ):
181172 data = sc .code (id )
182173 lines = data .code
183174 language = data .language
Original file line number Diff line number Diff line change 1010
1111from . import __pkg__ , __version__
1212
13- console = Console ()
13+ console = Console (highlight = True )
1414
1515
1616def print_jsonp (jsonp : str ) -> None :
You can’t perform that action at this time.
0 commit comments