mirror of https://github.com/jb55/nostril.git
Compare commits
6 Commits
5e16cdf023
...
1798b61c42
Author | SHA1 | Date |
---|---|---|
@RandyMcMillan | 1798b61c42 | |
William Casarin | 6d820231a6 | |
William Casarin | 6a4b977961 | |
William Casarin | 077b143614 | |
William Casarin | 9199027424 | |
@RandyMcMillan | c914d7a01d |
8
Makefile
8
Makefile
|
@ -55,9 +55,11 @@ nostril: $(HEADERS) $(OBJS) $(ARS)
|
|||
$(CC) $(CFLAGS) $(OBJS) $(ARS) -o $@
|
||||
|
||||
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
|
||||
mkdir -p $(PREFIX)/share/man/man1
|
||||
mkdir -p $(PREFIX)/bin
|
||||
install -m644 doc/nostril.1 $(PREFIX)/share/man/man1/nostril.1
|
||||
install -m755 nostril $(PREFIX)/bin/nostril
|
||||
install -m755 nostril-query $(PREFIX)/bin/nostril-query
|
||||
|
||||
config.h: configurator
|
||||
./configurator > $@
|
||||
|
|
|
@ -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')
|
||||
|
@ -12,6 +13,7 @@ parser.add_argument('-d', '--parameter')
|
|||
parser.add_argument('-t', '--hashtag')
|
||||
parser.add_argument('-i', '--ids')
|
||||
parser.add_argument('-k', '--kinds')
|
||||
parser.add_argument('-s', '--search')
|
||||
parser.add_argument('-g',
|
||||
'--generic',
|
||||
nargs=2,
|
||||
|
@ -40,6 +42,9 @@ if args.generic:
|
|||
(tag, val) = args.generic
|
||||
filt["#" + tag] = val.split(",")
|
||||
|
||||
if args.search:
|
||||
filt["search"] = args.search
|
||||
|
||||
if args.hashtag is not None:
|
||||
filt["#t"] = args.hashtag.split(",")
|
||||
|
||||
|
@ -56,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)
|
||||
|
|
Loading…
Reference in New Issue