diff options
| author | Dennis Fink | 2021-12-25 10:43:38 +0100 |
|---|---|---|
| committer | Dennis Fink | 2021-12-25 10:43:38 +0100 |
| commit | eda74c3020404628f9a7af37a36232d95f233803 (patch) | |
| tree | e0f3202a61df2ec7367fbfda806bdfcd5753478b | |
| parent | f7b1ba4140da6c644f1a692fb7e344630e6f0013 (diff) | |
| download | patternutils-eda74c3020404628f9a7af37a36232d95f233803.tar.gz patternutils-eda74c3020404628f9a7af37a36232d95f233803.zip | |
Use abspath in pmatch if --match-full-path is used
Diffstat (limited to '')
| -rw-r--r-- | patternutils/commands/pmatch.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/patternutils/commands/pmatch.py b/patternutils/commands/pmatch.py index f69df48..3884a9d 100644 --- a/patternutils/commands/pmatch.py +++ b/patternutils/commands/pmatch.py @@ -18,7 +18,7 @@ def apply_regex( ) -> Generator[Optional[dict[str, str]], None, None]: for f in walk_function: - subject = f.path if match_full_path else f.name + subject = os.path.abspath(f.path) if match_full_path else f.name try: match = mat.apply(subject, regex_pattern) except ValueError: @@ -59,7 +59,7 @@ def apply_regex( "--match-full-path", is_flag=True, default=False, - help="match on full path instead of only filename", + help="match on full absolute path instead of only the filename", ) @click.option( "-p", |
