nostril

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

commit 6a4b9779619171fdfa840ef62ef983be2efc46bd
parent 077b143614111a840666156655fb67fc5b225d6d
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 13 Feb 2024 15:39:45 -0800

query: add -r (--raw) param

This removes the envelope

Diffstat:
Mnostril-query | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/nostril-query b/nostril-query @@ -5,6 +5,7 @@ import argparse import json parser = argparse.ArgumentParser(prog = 'nostril-query', description = 'Construct nostr queries') +parser.add_argument('-r', '--raw', action=argparse.BooleanOptionalAction) parser.add_argument('-a', '--authors') parser.add_argument('-p', '--mentions') parser.add_argument('-e', '--references') @@ -60,5 +61,10 @@ if args.kinds is not None: kinds = args.kinds.split(",") filt["kinds"] = [a for a in map(lambda s: int(s), kinds)] -q = json.dumps(["REQ","nostril-query",filt]) +q = "" +if args.raw is not None: + q = json.dumps(filt) +else: + q = json.dumps(["REQ","nostril-query",filt]) + print(q)