gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet-nim] 58/61: groupchat: improve CLI UX


From: gnunet
Subject: [GNUnet-SVN] [gnunet-nim] 58/61: groupchat: improve CLI UX
Date: Sat, 13 Apr 2019 13:36:33 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnunet-nim.

commit ec4bf936a34448caf27645b6697fddc36407876e
Author: psyc://loupsycedyglgamf.onion/~lynX 
<ircs://psyced.org/youbroketheinternet>
AuthorDate: Sun Sep 16 13:03:19 2018 +0000

    groupchat: improve CLI UX
---
 examples/Makefile      |  5 +++++
 examples/groupchat.nim | 12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644
index 0000000..e583032
--- /dev/null
+++ b/examples/Makefile
@@ -0,0 +1,5 @@
+groupchat: groupchat.nim
+       nim compile $<
+
+run:
+       ./groupchat -p=23014 -c=gnunet1.conf
diff --git a/examples/groupchat.nim b/examples/groupchat.nim
index 93d4323..d6ef46d 100644
--- a/examples/groupchat.nim
+++ b/examples/groupchat.nim
@@ -76,12 +76,22 @@ proc main() =
       of "port", "p": port = value
     else:
       assert(false)
+  if configfile.isNil():
+    echo "I need a config file to use."
+    echo "  Add -c=<gnunet.conf>"
+    return
+  if port.isNil():
+    echo "I need a shared secret port to use."
+    echo "  Add -p=<sharedsecret>"
+    return
+  if server.isNil():
+    echo "Entering server mode."
   var gnunetApp = initGnunetApplication(configfile)
   asyncCheck firstTask(gnunetApp, server, port)
   while hasPendingOperations():
     poll(gnunetApp.millisecondsUntilTimeout())
     gnunetApp.doWork()
-  echo "quitting"
+  echo "Quitting."
 
 main()
 GC_fullCollect()

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]