nostril

A C cli tool for creating nostr events
git clone git://jb55.com/nostril
Log | Files | Refs | Submodules | LICENSE

commit 0aaf9eb263a1516cd983e61e438ae0ffc98290c1
parent f4325e89f5532bb830f3d27795fb3cfc1c48b25c
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 17 Nov 2022 18:12:56 -0800

nostril-query: add kinds

Diffstat:
MMakefile | 3++-
Mnostril-query | 4++++
Mnostril.c | 2+-
Mscripts/git-show-nostr | 2+-
4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile @@ -24,8 +24,8 @@ dist: docs version cd dist;\ sha256sum *.tar.gz > SHA256SUMS.txt;\ gpg -u 0x8A478B64FFE30F1095A8736BF5F27EFD1B38DABB --sign --armor --detach-sig --output SHA256SUMS.txt.asc SHA256SUMS.txt + cp CHANGELOG dist/CHANGELOG.txt rsync -avzP dist/ charon:/www/cdn.jb55.com/tarballs/nostril/ - scp CHANGELOG charon:/www/cdn.jb55.com/tarballs/nostril/CHANGELOG.txt deps/secp256k1/.git: @devtools/refresh-submodules.sh $(SUBMODULES) @@ -57,6 +57,7 @@ nostril: $(HEADERS) $(OBJS) $(ARS) install: all install -Dm644 doc/nostril.1 $(PREFIX)/share/man/man1/nostril.1 install -Dm755 nostril $(PREFIX)/bin/nostril + install -Dm755 nostril-query $(PREFIX)/bin/nostril-query config.h: configurator ./configurator > $@ diff --git a/nostril-query b/nostril-query @@ -10,6 +10,7 @@ parser.add_argument('-p', '--mentions') parser.add_argument('-e', '--references') parser.add_argument('-t', '--hashtag') parser.add_argument('-i', '--ids') +parser.add_argument('-k', '--kinds') parser.add_argument('-g', '--generic', nargs=2, @@ -47,6 +48,9 @@ if args.mentions: if args.references: filt["#e"] = args.references.split(",") +if args.kinds: + kinds = args.kinds.split(",") + filt["kinds"] = [a for a in map(lambda s: int(s), kinds)] q = json.dumps(["REQ","nostril-query",filt]) print(q) diff --git a/nostril.c b/nostril.c @@ -19,7 +19,7 @@ #include "random.h" #include "proof.h" -#define VERSION "0.1.0" +#define VERSION "0.1.2" #define MAX_TAGS 32 #define MAX_TAG_ELEMS 16 diff --git a/scripts/git-show-nostr b/scripts/git-show-nostr @@ -126,7 +126,7 @@ fi evid=$(jq -r ' def tag(name): .tags[] | select(.[0] == name) | .[1]; -. | [(.created_at | tostring), (.|tag("t")), (.|tag("author")), (.|tag("subject")), .pubkey[0:20], "id:\(.id)"] | @tsv' "$outname" | +. | [(.created_at | tostring), (.|tag("t")), (.|tag("subject")), (.|tag("author")), .pubkey[0:20], "id:\(.id)"] | @tsv' "$outname" | sort -rn | $dateformatter | column -t -s $'\t' |