diff --git a/README.md b/README.md index fc93960..83b3527 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[//]: # (Generated 2020-05-16T18:52:43.880845. Changes belong into template/documentation/readme.template) +[//]: # (Generated 2020-05-17T23:16:59.789529. Changes belong into template/documentation/readme.template) #Argodejo Program version 0.1 diff --git a/documentation/build.py b/documentation/build.py index c8b5d4b..399e271 100644 --- a/documentation/build.py +++ b/documentation/build.py @@ -120,6 +120,9 @@ with open ("manpageinclude.h2m", "w") as w: command = f"help2man ../{METADATA['shortName']} --no-info --include manpageinclude.h2m > {METADATA['shortName']}.1" subprocess.run(command, capture_output=True, text=True, shell=True) +#help2man for the much simpler nsm-data +commandNsmDataMNan = "help2man ../tools/nsm-data --no-info > nsm-data.1" +subprocess.run(commandNsmDataMNan, capture_output=True, text=True, shell=True) print ("Built. You still need to run") print ("sh build-documentation.sh") diff --git a/documentation/nsm-data.1 b/documentation/nsm-data.1 new file mode 100644 index 0000000..7cc65df --- /dev/null +++ b/documentation/nsm-data.1 @@ -0,0 +1,15 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.15. +.TH NSM-DATA "1" "May 2020" "nsm-data 1.0" "User Commands" +.SH NAME +nsm-data \- manual page for nsm-data 1.0 +.SH DESCRIPTION +usage: nsm\-data [\-h] [\-v] +.PP +nsm\-data is a module for Argodejo. It only communicates over OSC in an NSMSession and has no standalone functionality. +.SS "optional arguments:" +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-v\fR, \fB\-\-version\fR +show program's version number and exit diff --git a/documentation/out/english.html b/documentation/out/english.html index 0111f28..ea245ff 100644 --- a/documentation/out/english.html +++ b/documentation/out/english.html @@ -1241,7 +1241,7 @@ The easiest way is to contact the developers and they will setup the new languag diff --git a/documentation/out/german.html b/documentation/out/german.html index f3e1c8b..e72810c 100644 --- a/documentation/out/german.html +++ b/documentation/out/german.html @@ -1247,7 +1247,7 @@ Ansonsten starten Sie argodejo mit diesem Befehl, Sprachcode ändern, vom Termin diff --git a/tools/nsm-data b/tools/nsm-data index 2eb9cd8..e56ac86 100755 --- a/tools/nsm-data +++ b/tools/nsm-data @@ -22,16 +22,23 @@ along with this program. If not, see . import logging; logger = logging.getLogger("nsm-data"); logger.info("import") +URL="https://www.laborejo.org/argodejo/nsm-data" +HARD_LIMIT = 512 # no single message longer than this +VERSION= 1.0 + +#In case the user tries to run this standalone. +import argparse +parser = argparse.ArgumentParser(description="nsm-data is a module for Argodejo. It only communicates over OSC in an NSM-Session and has no standalone functionality.") +parser.add_argument("-v", "--version", action='version', version=str(VERSION)) +args = parser.parse_args() + import json import pathlib from time import sleep from sys import exit as sysexit from nsmclient import NSMClient - -URL="https://www.laborejo.org/argodejo/nsm-data" -VERSION= 1.0 -HARD_LIMIT = 512 # no single message longer than this +from nsmclient import NSMNotRunningError def chunkstring(string): return [string[0+i:HARD_LIMIT+i] for i in range(0, len(string), HARD_LIMIT)] @@ -289,4 +296,7 @@ class DataClient(object): if __name__ == '__main__': """Creating an instance starts the client and does not return""" - DataClient() + try: + DataClient() + except NSMNotRunningError: + parser.print_help()