You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Searching information is not displayed by default. If you play more attention to the search information, you can use the `[-v --verbose]` flag to show it when searching.
Generally speaking, the configuration file of `code-counter` already contains many common default configurations. For example, the default value of `ignore` is shown below.
203
233
204
-
```json
234
+
```
205
235
"ignore": [
206
-
"out",
207
236
"venv",
208
237
".git",
209
238
".idea",
@@ -215,7 +244,7 @@ Generally speaking, the configuration file of `code-counter` already contains ma
215
244
]
216
245
```
217
246
218
-
Therefore, in some cases, if the directory or file to be searched is the same as the default value of `ignore`, you can set `--ignore=""` to empty the default value of `ignore`. Of course, this is temporary. If you want to persist with these changes, you can refer to the `--ignore-reset` flag mentioned later when introducing `cocnt config`.
247
+
Therefore, in some cases, if the directory or file to be searched is the same as the default value of `ignore`, you can set `--ignore=""` to empty the default value of `ignore`. Of course, this is temporary. If you want to persist with these changes, you can refer to the [`--ignore-reset` flag](#reset-the-value-of-the-configuration-variable) mentioned later when introducing [`cocnt config`](#config).
219
248
220
249
### Specify the output path to save the search results
221
250
@@ -241,7 +270,71 @@ In addition to the statistical data displayed on the terminal, the statistical c
Search and count the remote repository with a given Github or Gitee HTTP link
282
+
283
+
positional arguments:
284
+
repository search and count a remote repository
285
+
286
+
optional arguments:
287
+
-h, --help show this help message and exit
288
+
-v, --verbose show verbose information
289
+
-g, --graph choose to whether to visualize the result
290
+
-o OUTPUT_PATH, --output OUTPUT_PATH
291
+
specify an output path if you want to store the result
292
+
--suffix SUFFIX what code files do you want to count
293
+
--comment COMMENT the comment symbol, which can be judged whether the current line is a comment
294
+
--ignore IGNORE ignore some directories or files that you don't want to count
295
+
```
296
+
297
+
`cocnt remote` in addition to supporting the searching of the remote repository, the usage of its various flags is the same as `cocnt search`
298
+
299
+
#### Search and count the remote repository
300
+
301
+
Given the `HTTPS` or `SSH` link of the remote repository, `code-counter` can search and count the remote repository.
302
+
At present, it supports access to the repository of `Github` and `Gitee`.
303
+
304
+
Because of the API access limit for `Github` and `Gitee`, they are only used a very small number of times per day.
305
+
So we recommend that users follow the instructions and enter the access token corresponding to `Github` or `Gitee` into `code-counter` during the initial search to get at least 5000 uses per day.
306
+
307
+
When first accessing a `Github` repository, the user is prompted for a `Github` access token, and the same is true for accessing a `Gitee` repository. `code-counter` will display different prompts for different remote repositories.
308
+
Of course, you can use the remote search feature without entering an access token, but when the API usage limit is reached, `code-counter` will still prompt the user for an access token, otherwise you will not be able to continue using it that day.
309
+
310
+
The access tokens for different remote repositories are generated as follows.
If you want to update the access token at any time, then you can refer to the [`--github-token` and `--gitee-token` flags](#update-the-access-tokens) that will be mentioned later in the introduction of [`cocnt config`](#config).
336
+
337
+
### config
245
338
246
339
Configure `code-counter`, and the help information of `cocnt config` is as follows.
247
340
@@ -325,7 +418,6 @@ $ cocnt config --list
325
418
"\"\"\"\""
326
419
],
327
420
"ignore": [
328
-
"out",
329
421
"venv",
330
422
".git",
331
423
".idea",
@@ -350,15 +442,15 @@ The default configuration of `code-counter` basically includes common code file
350
442
+ `--comment-reset` can reset the default comment symbols
351
443
+ `--ignore-reset` can reset the default directory or files to ignore
352
444
353
-
These 3 flags can be used in combination or separately. You will be asked for each operation that will modify the configuration file, you can check whether the content to be modified is correct. If you are sure to modify, you can enter `y`, otherwise enter `n` to not modify.
445
+
These 3 flags can be used in combination or separately. You will be asked for each operation that will modify the configuration file, you can check if what you want to change is correct. If you confirm the change you can enter `y`, otherwise enter `n` to not perform the change.
354
446
355
447
Multiple values can be separated by commas, as shown in the following example.
'suffix' will be replaced with ['cpp', 'java'] . (y/n) y
452
+
'comment' will be replaced with ['//', '/*', '*'] . (y/n) y
453
+
'ignore' will be replaced with ['build', 'target'] . (y/n) y
362
454
```
363
455
364
456
#### Add the value of the configuration variable
@@ -368,7 +460,7 @@ For the case of adding the value of the configuration variable, the following fl
368
460
+ `--comment-add` add comment symbols
369
461
+ `--ignore-add` add the directories or files to ignore
370
462
371
-
These 3 flags can be used in combination or separately. You will be asked for each operation that will modify the configuration file, you can check whether the content to be modified is correct. If you are sure to modify, you can enter `y`, otherwise enter `n` to not modify.
463
+
These 3 flags can be used in combination or separately. You will be asked for each operation that will modify the configuration file, you can check if what you want to change is correct. If you confirm the change you can enter `y`, otherwise enter `n` to not perform the change.
372
464
373
465
Multiple values can be separated by commas, as shown in the following example.
374
466
@@ -386,7 +478,7 @@ For the deletion of configuration variable values, `code-counter` provides the f
386
478
+ `--comment-del` delete unwanted comment symbols from the default configuration
387
479
+ `--ignore-del` delete the directory or file names that don't need to be ignored from the default configuration
388
480
389
-
These 3 flags can be used in combination or separately. You will be asked for each operation that will modify the configuration file, you can check whether the content to be modified is correct. If you are sure to modify, you can enter `y`, otherwise enter `n` to not modify.
481
+
These 3 flags can be used in combination or separately. You will be asked for each operation that will modify the configuration file, you can check if what you want to change is correct. If you confirm the change you can enter `y`, otherwise enter `n` to not perform the change.
390
482
391
483
Multiple values can be separated by commas, as shown in the following example.
'ignore' will remove ['build', 'target'] . (y/n) y
398
490
```
399
491
492
+
#### Update the access tokens
493
+
494
+
For updates to access tokens for `Github` and `Gitee`, `code-counter` provides the following flags.
495
+
+ `--github-token` update the access token for `Github`
496
+
+ `--gitee-token` update the access token for `Gitee`
497
+
498
+
These 2 flags can be used in combination or separately. You will be asked for each operation that will modify the configuration file, you can check if what you want to change is correct. If you confirm the change you can enter `y`, otherwise enter `n` to not perform the change.
0 commit comments