Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple PATH arguments, truncation fix, fmt, clippy #92

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

totph
Copy link
Contributor

@totph totph commented Feb 6, 2024

One bugfix when printing results, add support to search in more than one PATH, bring the README up to date, plus smaller fixups:


Fix result truncation being off by one

The final '}' in a block was truncated when no line numbers were used.


Accept multiple PATH arguments

Reading from stdin / '-' can be one of them.

Plus when searching in '.' avoid the middle dot like
'/path/./src/foo.c' when converting to an absolute path.

Update README.md with new --help output and fix trailing whitespace.


Fix alignment of -h/--help output


Fix clippy warnings and a typo


Run cargo fmt


Mostly caused by &str = "\NL .." removing the newline and any leading white
space on the following line.

```diff
@@ -16,1 -16,1 @@
-weggli 0.2.4
+ weggli 0.2.4
  Felix Wilhelm <[email protected]>
  ARGS:
-     <PATTERN>    Search pattern.
+    <PATTERN>    Search pattern.
     <PATH>       A file or directory to search.
 [..]
  OPTIONS:
-     -A, --after <after>                 Lines to print after a match. Default = 5.
+    -A, --after <after>                 Lines to print after a match. Default = 5.
     -B, --before <before>               Lines to print before a match. Default = 5.
 [..]
             not:     Negative sub queries. [..]
-           strict:   Enable stricter matching.
+            strict:  Enable stricter matching.
 [..]
```

and fix indentation of longer paragraphs and trailine white space.
Reading from stdin / '-' can be one of them.

Plus when searching in '.' avoid the middle dot like
'/path/./src/foo.c' when converting to an absolute path.

Update README.md with new --help output and fix trailing whitespace.
The final '}' in a block was truncated when no line numbers were used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant