From cf1a1651cf313f1544cb626d9601e488373dfde6 Mon Sep 17 00:00:00 2001 From: amadejpapez Date: Sat, 6 Nov 2021 20:04:22 +0100 Subject: [PATCH 1/2] fix: Amazon EC2 ID getting matched a lot --- pywhat/Data/regex.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pywhat/Data/regex.json b/pywhat/Data/regex.json index 25a67b0..27a5c9c 100644 --- a/pywhat/Data/regex.json +++ b/pywhat/Data/regex.json @@ -2399,8 +2399,8 @@ } }, { - "Name": "Amazon Web Services EC2 Instance Identifier", - "Regex": "(?i)^(\\b[a-z]+-[a-z0-9]+)$", + "Name": "Amazon Web Services EC2 Instance ID", + "Regex": "(?i)^(i-([a-z0-9]{8}|[a-z0-9]{17}))$", "plural_name": false, "Description": null, "Rarity": 0.2, @@ -2412,7 +2412,8 @@ ], "Examples": { "Valid": [ - "i-1234567890abcdef0" + "i-1234567890abcdef0", + "i-1a2b3c4d" ], "Invalid": [] } From f1ed9d4f741f1a30d850c1489f7400981c1cdc93 Mon Sep 17 00:00:00 2001 From: amadejpapez Date: Sat, 6 Nov 2021 20:13:10 +0100 Subject: [PATCH 2/2] fix: typos in help menu, smaller titles in template --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++---- pywhat/what.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 822b66b..a54644a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,15 +1,15 @@ **⚠ Pull Requests not made with this template will be automatically closed 🔥** -# Prerequisites +## Prerequisites - [ ] Have you read the documentation on contributing? https://github.com/bee-san/pyWhat/wiki/Adding-your-own-Regex -# Why do we need this pull request? +## Why do we need this pull request? * Explain the _why_ behind your PR. We can see what it does from the code. But _why_ does it do that? -# What [GitHub issues](https://github.com/bee-san/pyWhat/issues) does this fix? +## What [GitHub issues](https://github.com/bee-san/pyWhat/issues) does this fix? * Fixes #10000 -# Copy / paste of output +## Copy / paste of output Please copy and paste the output of PyWhat with your new addition using an example that tests this addition below: diff --git a/pywhat/what.py b/pywhat/what.py index 9ed31da..5627bda 100644 --- a/pywhat/what.py +++ b/pywhat/what.py @@ -120,7 +120,7 @@ def get_text(ctx, opts, value): required=False, help="Format output according to specified rules.", ) -@click.option("-pt", "--print-tags", is_flag=True, help="Add flags to ouput") +@click.option("-pt", "--print-tags", is_flag=True, help="Add flags to output") def main(**kwargs): """ pyWhat - Identify what something is. @@ -193,7 +193,7 @@ def main(**kwargs): pretty - Output data in the table - json - Ouput data in json format + json - Output data in json format CUSTOM_STRING - Print data in the way you want. For every match CUSTOM_STRING will be printed and '%x' (See below for possible x values) will be substituted with a match value. @@ -214,11 +214,11 @@ def main(**kwargs): %d - description (will not output if absent) - %e - exploit (will not ouput if absent) + %e - exploit (will not output if absent) %r - rarity - %l - link (will not ouput if absent) + %l - link (will not output if absent) %t - tags (in 'tag1, tag2 ...' format)