List unknown numbers when adding contact

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
Stacy Harper 2021-05-15 18:42:00 +02:00 committed by Maarten van Gompel
parent cc81deeb10
commit 2c47c5e55f
2 changed files with 13 additions and 4 deletions

View file

@ -40,8 +40,17 @@ all_contacts() {
}' "$CONTACTSFILE" | sort -f -k 2
}
unknown_contacts() {
contacts \
| grep "Unknown Number$" \
| cut -d: -f1 \
| grep "^+[0-9]\{9,14\}$"
}
if [ "$1" = "--all" ]; then
all_contacts
elif [ "$1" = "--unknown" ]; then
unknown_contacts
else
contacts
fi