From 3b81f1e3caacc7dae5783c533d4a838d473cc241 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 11 Jul 2021 16:21:40 +0300 Subject: [PATCH] Build hjson-cli --- bin/.gitignore | 1 + bin/all.do | 2 +- bin/clean.do | 2 +- bin/hjson-cli.do | 3 +++ doc/building.texi | 3 ++- doc/cfg/index.texi | 8 ++++++++ 6 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 bin/hjson-cli.do diff --git a/bin/.gitignore b/bin/.gitignore index a507544..b3d9328 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1 +1,2 @@ +hjson-cli nncp-* diff --git a/bin/all.do b/bin/all.do index 5519b54..2b31559 100644 --- a/bin/all.do +++ b/bin/all.do @@ -1,2 +1,2 @@ -redo-ifchange cmd.list +redo-ifchange cmd.list hjson-cli redo-ifchange `cat cmd.list` diff --git a/bin/clean.do b/bin/clean.do index 7dbb858..86a5019 100644 --- a/bin/clean.do +++ b/bin/clean.do @@ -1 +1 @@ -rm -f `cat cmd.list` +rm -f `cat cmd.list` hjson-cli diff --git a/bin/hjson-cli.do b/bin/hjson-cli.do new file mode 100644 index 0000000..c7d40d2 --- /dev/null +++ b/bin/hjson-cli.do @@ -0,0 +1,3 @@ +cd ../src +GO=${GO:-go} +$GO build -o ../bin/$3 github.com/hjson/hjson-go/hjson-cli diff --git a/doc/building.texi b/doc/building.texi index afe9f40..30376dc 100644 --- a/doc/building.texi +++ b/doc/building.texi @@ -17,6 +17,7 @@ $ gpg --verify nncp-@value{VERSION}.tar.xz.sig nncp-@value{VERSION}.tar.xz $ xz --decompress --stdout nncp-@value{VERSION}.tar.xz | tar xf - $ cd nncp-@value{VERSION} $ redo all +# look for bin/nncp-* binaries (and possibly hjson-cli one) @end example It uses @url{http://cr.yp.to/redo.html, redo} build system for that @@ -28,7 +29,7 @@ in tarball. Following ones are tested to work with: @url{https://redo.readthedocs.io/, apenwarr/redo} (@code{contrib/do} is from that project), @url{https://github.com/leahneukirchen/redo-c, redo-c}. -There is @command{install} make-target respecting @env{DESTDIR}. It will +There is @command{install} target respecting @env{DESTDIR}. It will install binaries and info-documentation: @example diff --git a/doc/cfg/index.texi b/doc/cfg/index.texi index b44f243..b1261a8 100644 --- a/doc/cfg/index.texi +++ b/doc/cfg/index.texi @@ -30,6 +30,14 @@ neigh: { } @end verbatim +Do not forget that Hjson can be safely converted to JSON and vice versa +(loosing formatting and comments of course). By default +@command{hjson-cli} utility from @code{github.com/hjson/hjson-go} is +built together with @command{nncp-*} commands too. For querying +information from the JSON from the command line you can use +@code{github.com/itchyny/gojq} and @code{github.com/skanehira/gjo} for +building it up. + And for being able to communicate with at least one other node, you just need to add single key to the @code{neigh} section similar to the "self". -- 2.44.0