mirror of
https://github.com/jb55/nostril.git
synced 2025-08-06 01:28:29 -04:00
query: add -r (--raw) param
This removes the envelope
This commit is contained in:
@@ -5,6 +5,7 @@ import argparse
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(prog = 'nostril-query', description = 'Construct nostr queries')
|
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('-a', '--authors')
|
||||||
parser.add_argument('-p', '--mentions')
|
parser.add_argument('-p', '--mentions')
|
||||||
parser.add_argument('-e', '--references')
|
parser.add_argument('-e', '--references')
|
||||||
@@ -60,5 +61,10 @@ if args.kinds is not None:
|
|||||||
kinds = args.kinds.split(",")
|
kinds = args.kinds.split(",")
|
||||||
filt["kinds"] = [a for a in map(lambda s: int(s), kinds)]
|
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)
|
print(q)
|
||||||
|
Reference in New Issue
Block a user