commit 012023b2ecd819fe4a8c45635cb88c9e61990637
parent 7feb8715356ed9db8b9e3d02d4968f82651f6817
Author: Ed van Bruggen <edvb54@gmail.com>
Date: Wed, 30 Aug 2017 22:18:41 -0700
Remove search, using grep is better
Diffstat:
3 files changed, 3 insertions(+), 30 deletions(-)
diff --git a/README.md b/README.md
@@ -2,7 +2,7 @@
## SYNOPSIS
-`nt` [**-Dilvy**] [**-f** *FILE*] [**-e** *NOTE*] [**-d** *NOTE*] [**-s** *SEARCH*] [**-t** [*TAG*]] [**-n** *NUM* | **-NUM**] [*NOTE* ...]
+`nt` [**-Dilvy**] [**-f** *FILE*] [**-e** *NOTE*] [**-d** *NOTE*] [**-t** [*TAG*]] [**-n** *NUM* | **-NUM**] [*NOTE* ...]
## DESCRIPTION
@@ -36,9 +36,6 @@ by prefixing the note with a tag followed by a colon. For example a note
**-n** *NUM*, **-NUM**
List last *NUM* notes
-**-s** *SEARCH*
- Search for pattern *SEARCH* in notes
-
**-t** [*TAG*]
Search for *TAG* in notes, list all tags if no *TAG* is given
diff --git a/nt.1 b/nt.1
@@ -4,7 +4,7 @@
nt \- simple note taker
.SH SYNOPSIS
.PP
-\fB\fCnt\fR [\fB\-Dilvy\fP] [\fB\-f\fP \fIFILE\fP] [\fB\-e\fP \fINOTE\fP] [\fB\-d\fP \fINOTE\fP] [\fB\-s\fP \fISEARCH\fP] [\fB\-t\fP [\fITAG\fP]] [\fB\-n\fP \fINUM\fP | \fB\-NUM\fP] [\fINOTE\fP ...]
+\fB\fCnt\fR [\fB\-Dilvy\fP] [\fB\-f\fP \fIFILE\fP] [\fB\-e\fP \fINOTE\fP] [\fB\-d\fP \fINOTE\fP] [\fB\-t\fP [\fITAG\fP]] [\fB\-n\fP \fINUM\fP | \fB\-NUM\fP] [\fINOTE\fP ...]
.SH DESCRIPTION
.PP
Simple note taker for the command line. To take a note simply run the command
@@ -36,9 +36,6 @@ by prefixing the note with a tag followed by a colon. For example a note
\fB\-n\fP \fINUM\fP, \fB\-NUM\fP
List last \fINUM\fP notes
.PP
-\fB\-s\fP \fISEARCH\fP
- Search for pattern \fISEARCH\fP in notes
-.PP
\fB\-t\fP [\fITAG\fP]
Search for \fITAG\fP in notes, list all tags if no \fITAG\fP is given
.PP
diff --git a/nt.c b/nt.c
@@ -30,7 +30,6 @@ void nt_del_all(void);
void nt_edit(void);
void nt_list_all(void);
void nt_list_n(void);
-void nt_search(void);
void nt_new(void);
void setup(void);
@@ -188,23 +187,6 @@ nt_list_n(void)
printf("%s\n", cur->str);
}
-/* search notes for given note */
-void
-nt_search(void)
-{
- if (!sub) usage();
- int found = 0;
- Note *cur = head;
-
- for (; cur; cur = cur->next)
- if (strstr(cur->str, sub)) {
- printf("%s\n", cur->str);
- found = 1;
- }
- if (!found)
- die("%s: search: '%s' not found", argv0, sub);
-}
-
/* list all categories or all notes with a given category */
void
nt_cat(void)
@@ -284,7 +266,7 @@ void
usage(void)
{
die("usage: %s [-Dilyv] [-f FILE] [-e NOTE] [-d NOTE]\n"
- " [-s SEARCH] [-c [CATEGORY]] [-n NUM | -NUM] [NOTE ...]", argv0);
+ " [-c [CATEGORY]] [-n NUM | -NUM] [NOTE ...]", argv0);
}
int
@@ -321,9 +303,6 @@ main(int argc, char *argv[])
neednt = 0;
lsnum = ARGNUMF();
break;
- case 's':
- mode = nt_search;
- break;
case 'c':
mode = nt_cat;
neednt = 0;