https://github.com/tpkn/is_in
A CLI tool for checking whether the parameters from first string are present in second string
https://github.com/tpkn/is_in
Last synced: about 1 month ago
JSON representation
A CLI tool for checking whether the parameters from first string are present in second string
- Host: GitHub
- URL: https://github.com/tpkn/is_in
- Owner: tpkn
- License: mit
- Created: 2021-08-13T00:03:11.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-29T23:38:20.000Z (about 3 years ago)
- Last Synced: 2025-01-14T08:12:54.029Z (over 1 year ago)
- Language: Go
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Is in
A CLI tool for checking whether the parameters from first string are present in second string
## Usage
```text
is_in [-options]
```
## Options
```text
-i, --ignorecase Ignore case (default: false)
-d, --delimiter Parameters delimiter (default: ",")
-p, --prepare Prepare parameters before comparison (default: false): trim spaces and replace wrapping single/double quotes
-w, --why Print comparsison details (default: false)
--help Help
--version Print current version
```
## Shell usage
```shell
is_in ",f,g,b , ,c" "a,b,c"
# => "false"
is_in -why ",f,g,b , ,c" "a,b,c"
# =>
# Failed because:
# 1. 'f' is missing
# 2. 'g' is missing
# 3. 'b ' is missing
```
```shell
ok=$(is_in -p "a, b, c" "d,c")
if [ "$ok" = "false" ]; then
echo "Error!"
exit
fi
```