Skip to content

Commit 40f610e

Browse files
authored
docs: Add docs for --dependency option and fix typo (closes #155) (#156)
1 parent 5be0860 commit 40f610e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ In short, Twyn protects you against [typosquatting attacks](https://en.wikipedia
1515

1616
It works as follows:
1717

18-
1. It will try to find a dependencies file in your working path. You can freely specify a different path for that file.
19-
2. If your installed package name matches with the name of one of the most well known packages, the package is accepted.
20-
3. If the name of your package is similar to the name one of the most used packages, Twyn will prompt an error.
18+
1. Either choose to scan the dependencies in a dependencies file you specify (`--dependency-file`) or some dependencies introduced through the CLI (`--dependency`). If no option was provided, it will try to find a dependencies file in your working path.
19+
2. If the name of your package name matches with the name of one of the most well known packages, the package is accepted.
20+
3. If the name of your package is similar to the name of one of the most used packages, Twyn will prompt an error.
2121
4. If your package name is not in the list of the most known ones and is not similar enough to any of those to be considered misspelled, the package is accepted. Twyn assumes that you're using either a not so popular package (therefore it can't verify its legitimacy) or a package created by yourself, therefore unknown for the rest.
2222

2323
## Docker
@@ -60,6 +60,17 @@ Currently it supports these dependency file formats.
6060
- `requirements.txt`
6161
- `poetry.lock`
6262

63+
### Check dependencies introduced through the CLI
64+
You can also check a dependency by entering it through the command line:
65+
66+
twyn run --dependency <dependency>
67+
68+
It does accept multiple dependencies at a time:
69+
70+
twyn run --dependency <dependency> --dependency <another_dependency>
71+
72+
When this option is selected, no dependency file is checked.
73+
6374
### Selector method
6475
You can choose between different operational modes:
6576
- `all`: Default option. It is the most exhaustive mode. It will check your package names against the trusted ones without any assumption.
@@ -84,4 +95,4 @@ All the configurations available through the command line are also supported in
8495
dependency_file="/my/path/requirements.txt"
8596
selector_method="first_letter"
8697
logging_level="debug"
87-
allowlist=["my_package"]
98+
allowlist=["my_package"]

0 commit comments

Comments
 (0)