[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: prepared command line tool (ana
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: prepared command line tool (anastasis-assembler) |
Date: |
Sun, 17 May 2020 08:33:22 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new a28fbc6 prepared command line tool (anastasis-assembler)
a28fbc6 is described below
commit a28fbc6c917569fe95ef4ee5fce6303d0c5aac23
Author: Dennis Neufeld <address@hidden>
AuthorDate: Sun May 17 06:33:18 2020 +0000
prepared command line tool (anastasis-assembler)
---
.gitignore | 2 +
src/cli/Makefile.am | 23 +++++-
...is-cli-splitter.c => anastasis-cli-assembler.c} | 88 +++++-----------------
src/cli/anastasis-cli-splitter.c | 4 -
4 files changed, 43 insertions(+), 74 deletions(-)
diff --git a/.gitignore b/.gitignore
index d9271bf..5c131a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,5 +92,7 @@ src/stasis/valgrind*.txt
src/util/valgrind*.txt
src/lib/test_anastasis
src/cli/anastasis-splitter
+src/cli/anastasis-assembler
src/cli/.deps/
src/cli/.deps/anastasis-cli-splitter.Po
+src/cli/.deps/anastasis-cli-assembler.Po
diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am
index cf68ace..51b79ed 100644
--- a/src/cli/Makefile.am
+++ b/src/cli/Makefile.am
@@ -2,7 +2,8 @@
AM_CPPFLAGS = -I$(top_srcdir)/src/include
bin_PROGRAMS = \
- anastasis-splitter
+ anastasis-splitter \
+ anastasis-assembler
if USE_COVERAGE
AM_CFLAGS = --coverage -O0
@@ -10,7 +11,7 @@ if USE_COVERAGE
endif
anastasis_splitter_SOURCES = \
- anastasis-cli-splitter.c
+ anastasis-cli-splitter.c
anastasis_splitter_LDADD = \
-lanastasis \
-lanastasisutil \
@@ -25,11 +26,29 @@ anastasis_splitter_LDADD = \
-luuid \
$(XLIB)
+anastasis_assembler_SOURCES = \
+ anastasis-cli-assembler.c
+anastasis_assembler_LDADD = \
+ -lanastasis \
+ -lanastasisutil \
+ -lanastasisrest \
+ -ltalermerchant \
+ -ltalerjson \
+ -ltalerutil \
+ -lgnunetjson \
+ -lgnunetcurl \
+ -lgnunetutil \
+ -ljansson \
+ -luuid \
+ $(XLIB)
+
if HAVE_LIBCURL
anastasis_splitter_LDADD += -lcurl
+anastasis_assembler_LDADD += -lcurl
else
if HAVE_LIBGNURL
anastasis_splitter_LDADD += -lgnurl
+anastasis_assembler_LDADD += -lgnurl
endif
endif
diff --git a/src/cli/anastasis-cli-splitter.c
b/src/cli/anastasis-cli-assembler.c
similarity index 75%
copy from src/cli/anastasis-cli-splitter.c
copy to src/cli/anastasis-cli-assembler.c
index 786608b..8ae56e1 100644
--- a/src/cli/anastasis-cli-splitter.c
+++ b/src/cli/anastasis-cli-assembler.c
@@ -14,7 +14,7 @@
Anastasis; see the file COPYING.GPL. If not, see
<http://www.gnu.org/licenses/>
*/
/**
- * @file cli/anastasis-cli-splitter.c
+ * @file cli/anastasis-cli-assembler.c
* @brief command line tool for anastasis
* @author Christian Grothoff
* @author Dennis Neufeld
@@ -96,15 +96,11 @@ read_keyboard_command (void *cls)
"\nOPTIONS:\n"
"'x' to quit\n"
"'o' to show these options\n"
- "'server' to show added server\n"
- "'server add' to add a provider/server\n"
- "'truth' to show created truths\n"
- "'truth add' to add truth to a server\n"
- "'truth add question' to create a truth with method 'secure
question'\n"
- "'truth --secrets' to show created truths with their secrets"
- "'policy' to show created policies\n"
- "'policy add' to add truths to a policy\n"
- "'publish' to upload the recovery document\n"
+ "'truth' to show all truths\n" // FIXME
+ "'truth --all' to show all truths" // FIXME
+ "'policy' to show all policies\n"
+ "'try' to check whether you have to pay for truth\n"
+ "'answer' to solve a challenge\n"
"\n"
);
GNUNET_free (buffer);
@@ -122,27 +118,6 @@ read_keyboard_command (void *cls)
return;
}
- if (0 == strncmp ("server",
- buffer,
- strlen ("server")))
- {
- // FIXME "server" logic here
- start_read_keyboard ();
- GNUNET_free (buffer);
- buffer = NULL;
- return;
- }
- if (0 == strncmp ("server add",
- buffer,
- strlen ("server add")))
- {
- // FIXME "server add" logic here
- start_read_keyboard ();
- GNUNET_free (buffer);
- buffer = NULL;
- return;
- }
-
if (0 == strncmp ("truth",
buffer,
strlen ("truth")))
@@ -153,29 +128,9 @@ read_keyboard_command (void *cls)
buffer = NULL;
return;
}
- if (0 == strncmp ("truth add",
+ if (0 == strncmp ("truth --all",
buffer,
- strlen ("truth add")))
- {
- // FIXME "truth add" logic here
- start_read_keyboard ();
- GNUNET_free (buffer);
- buffer = NULL;
- return;
- }
- if (0 == strncmp ("truth add question",
- buffer,
- strlen ("truth add question")))
- {
- // FIXME "truth add question" logic here
- start_read_keyboard ();
- GNUNET_free (buffer);
- buffer = NULL;
- return;
- }
- if (0 == strncmp ("truth --secrets",
- buffer,
- strlen ("truth --secrets")))
+ strlen ("truth --all")))
{
// FIXME "truth --secrets" logic here
start_read_keyboard ();
@@ -194,22 +149,23 @@ read_keyboard_command (void *cls)
buffer = NULL;
return;
}
- if (0 == strncmp ("policy add",
+
+ if (0 == strncmp ("try",
buffer,
- strlen ("policy add")))
+ strlen ("try")))
{
- // FIXME "policy add" logic here
+ // FIXME "try" logic here
start_read_keyboard ();
GNUNET_free (buffer);
buffer = NULL;
return;
}
- if (0 == strncmp ("publish",
+ if (0 == strncmp ("answer",
buffer,
- strlen ("publish")))
+ strlen ("answer")))
{
- // FIXME "publish" logic here
+ // FIXME "answer" logic here
start_read_keyboard ();
GNUNET_free (buffer);
buffer = NULL;
@@ -297,13 +253,13 @@ run (void *cls,
(void) cfgfile;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Starting anastasis-splitter\n");
+ "Starting anastasis-assembler\n");
GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
NULL);
GNUNET_assert (GNUNET_OK ==
- GNUNET_log_setup ("anastasis-splitter",
+ GNUNET_log_setup ("anastasis-assembler",
"WARNING",
NULL));
@@ -321,10 +277,6 @@ main (int argc,
{
int ret;
- GNUNET_log_setup ("anastasis-splitter",
- "DEBUG",
- NULL);
-
/* the available command line options */
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_option_flag ('m',
@@ -340,8 +292,8 @@ main (int argc,
ret = GNUNET_PROGRAM_run (argc,
argv,
- "anastasis-splitter",
- "This is an application for using Anastasis to
split and share a secret.\n",
+ "anastasis-assembler",
+ "This is an application for using Anastasis to
assemble the core secret from recovery document.\n",
options,
&run,
NULL);
@@ -349,4 +301,4 @@ main (int argc,
return (GNUNET_OK == ret) ? 0 : 1;
}
-/* end of anastasis-cli-spliter.c */
\ No newline at end of file
+/* end of anastasis-cli-assembler.c */
\ No newline at end of file
diff --git a/src/cli/anastasis-cli-splitter.c b/src/cli/anastasis-cli-splitter.c
index 786608b..d7413a7 100644
--- a/src/cli/anastasis-cli-splitter.c
+++ b/src/cli/anastasis-cli-splitter.c
@@ -321,10 +321,6 @@ main (int argc,
{
int ret;
- GNUNET_log_setup ("anastasis-splitter",
- "DEBUG",
- NULL);
-
/* the available command line options */
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_option_flag ('m',
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: prepared command line tool (anastasis-assembler),
gnunet <=