Skip to content

Commit

Permalink
tweak to include better examples in help dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jun 7, 2023
1 parent 7d4f033 commit da37b89
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Why use cs?
- Rank results on the fly helping you find things
- Searches across multiple lines
- Has a nice TUI interface.
- Cross-platform (probably needs the new Windows terminal though)

The reason `cs` exists at all is because I was running into limitations using `rg TERM | fzf` and decided to solve my own
problem.
Expand Down Expand Up @@ -118,15 +119,24 @@ Command line usage of `cs` is designed to be as simple as possible.
Full details can be found in `cs --help` or `cs -h`. Note that the below reflects the state of master not a release, as such
features listed below may be missing from your installation.

```shell
```
$ cs -h
code spelunker (cs) code search.
Version 1.0.0
Version 1.1.1
Ben Boyter <ben@boyter.org>
cs recursively searches the current directory using some boolean logic
optionally combined with regular expressions.
searches by default use AND boolean syntax for all terms
- exact match using quotes "find this"
- fuzzy match within 1 or 2 distance fuzzy~1 fuzzy~2
- negate using NOT such as pride NOT prejudice
- regex with toothpick syntax /pr[e-i]de/
example search that uses all current functionality
- darcy NOT collins wickham~1 "ten thousand a year" "/pr[e-i]de/"
Usage:
cs [flags]
Expand Down
13 changes: 11 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
Version = "1.1.0"
Version = "1.1.1"
)

func main() {
Expand All @@ -23,7 +23,16 @@ func main() {
"Ben Boyter <ben@boyter.org>" +
"\n\n" +
"cs recursively searches the current directory using some boolean logic\n" +
"optionally combined with regular expressions." +
"optionally combined with regular expressions.\n" +
"\n" +
"searches by default use AND boolean syntax for all terms\n" +
" - exact match using quotes \"find this\"\n" +
" - fuzzy match within 1 or 2 distance fuzzy~1 fuzzy~2\n" +
" - negate using NOT such as pride NOT prejudice\n" +
" - regex with toothpick syntax /pr[e-i]de/\n" +
"\n" +
"example search that uses all current functionality\n" +
" - darcy NOT collins wickham~1 \"ten thousand a year\" \"/pr[e-i]de/\"\n" +
"\n",
Version: Version,
Run: func(cmd *cobra.Command, args []string) {
Expand Down

0 comments on commit da37b89

Please sign in to comment.