Skip to content

Commit f51eec6

Browse files
authored
Added a CLI with code highlighting, and table display for the results… (#20)
2 parents b1bda26 + d1fdc93 commit f51eec6

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

README.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<p align="center"><img src="https://github.com/user-attachments/assets/d28934e1-a1ab-4b6e-9d12-d64067a65a60"><br>Python SDK and Command-Line Utility for <a href="https://searchcode.com">Searchcode</a>.<br><i>Search 75 billion lines of code from 40 million projects</i></p>
22
<p align="center"></p>
33

4-
---
5-
64
```commandline
75
searchcode --help
86
```
@@ -17,8 +15,6 @@ for result in search.results:
1715
print(result)
1816
```
1917

20-
---
21-
2218
## Installation
2319

2420
```bash
@@ -56,6 +52,12 @@ Queries the code index and returns at most 100 results.
5652

5753
### Code Search Without Filters
5854

55+
#### CLI
56+
57+
```commandline
58+
searchcode test
59+
```
60+
5961
#### SDK
6062

6163
```python
@@ -68,16 +70,16 @@ for result in search.results:
6870
print(result)
6971
```
7072

71-
#### CLI
72-
73-
```commandline
74-
searchcode test
75-
```
76-
7773
---
7874

7975
### Filter by Language (Java and JavaScript)
8076

77+
#### CLI
78+
79+
````commandline
80+
searchcode test --languages java,javascript
81+
````
82+
8183
#### SDK
8284

8385
```python
@@ -90,16 +92,16 @@ for result in search.results:
9092
print(result.language)
9193
```
9294

93-
#### CLI
94-
95-
````commandline
96-
searchcode test --languages java,javascript
97-
````
98-
9995
___
10096

10197
### Filter by Source (BitBucket and CodePlex)
10298

99+
#### CLI
100+
101+
```commandline
102+
searchcode test --sources bitbucket,codeplex
103+
```
104+
103105
#### SDK
104106

105107
```python
@@ -112,16 +114,16 @@ for result in search.results:
112114
print(result.filename)
113115
```
114116

117+
___
118+
119+
### Filter by Lines of Code (Between 500 and 1000)
120+
115121
#### CLI
116122

117123
```commandline
118-
searchcode test --sources bitbucket,codeplex
124+
searchcode test --lines-of-code-gt 500 --lines-of-code-lt 1000
119125
```
120126

121-
___
122-
123-
### Filter by Lines of Code (Between 500 and 1000)
124-
125127
#### SDK
126128

127129
```python
@@ -135,16 +137,16 @@ for result in search.results:
135137
print(result)
136138
```
137139

140+
___
141+
142+
### With Callback Function (JSONP only)
143+
138144
#### CLI
139145

140146
```commandline
141-
searchcode test --lines-of-code-gt 500 --lines-of-code-lt 1000
147+
searchcode test --callback myCallback
142148
```
143149

144-
___
145-
146-
### With Callback Function (JSONP only)
147-
148150
#### SDK
149151

150152
```python
@@ -155,11 +157,7 @@ search = sc.search(query="test", callback="myCallback")
155157
print(search)
156158
```
157159

158-
#### CLI
159-
160-
```commandline
161-
searchcode test --callback myCallback
162-
```
160+
`
163161

164162
### Response Attribute Definitions
165163

@@ -198,6 +196,12 @@ ___
198196

199197
Returns the raw data from a code file given the code id which can be found as the `id` in a code search result.
200198

199+
#### CLI
200+
201+
```commandline
202+
searchode code 4061576
203+
```
204+
201205
#### SDK
202206

203207
#### Params
@@ -213,11 +217,7 @@ code = sc.code(4061576)
213217
print(code)
214218
```
215219

216-
#### CLI
217-
218-
```commandline
219-
searchode code 4061576
220-
```
220+
---
221221

222222
## About Searchcode
223223

0 commit comments

Comments
 (0)