From 8a88cd142195884be214024f3182457a46c7aa72 Mon Sep 17 00:00:00 2001
From: David Sehnal <david.sehnal@gmail.com>
Date: Sun, 24 Feb 2019 15:45:47 +0100
Subject: [PATCH] readme

---
 README.md                              | 6 ++++++
 src/servers/model/preprocess/master.ts | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/README.md b/README.md
index b056d10f9..a03c9462e 100644
--- a/README.md
+++ b/README.md
@@ -122,6 +122,12 @@ Run the image
 
     export NODE_PATH="build/src"; node build/state-docs
 
+**Convert any CIF to BinaryCIF**
+
+    node build/model-server/preprocess -i file.cif -ob file.bcif
+
+To see all available commands, use ``node build/model-server/preprocess -h``.
+
 ## Contributing
 Just open an issue or make a pull request. All contributions are welcome.
 
diff --git a/src/servers/model/preprocess/master.ts b/src/servers/model/preprocess/master.ts
index 7dbb2ba39..365d6f3fa 100644
--- a/src/servers/model/preprocess/master.ts
+++ b/src/servers/model/preprocess/master.ts
@@ -26,6 +26,7 @@ cmdParser.addArgument(['--folderNumProcesses', '-fp'], { help: 'Convert folder n
 
 interface CmdArgs {
     // bulk?: string,
+    help?: any,
     cfg?: string,
     input?: string,
     outCIF?: string,
@@ -36,6 +37,7 @@ interface CmdArgs {
     folderNumProcesses?: string
 }
 
+
 export interface PreprocessConfig {
     numProcesses?: number,
     customProperties?: ModelPropertyProviderConfig | string
@@ -43,6 +45,11 @@ export interface PreprocessConfig {
 
 const cmdArgs = cmdParser.parseArgs() as CmdArgs;
 
+if (Object.keys(cmdArgs).filter(k => (cmdArgs as any)[k] !== null).length === 0 || typeof cmdArgs.help !== 'undefined') {
+    cmdParser.printHelp();
+    process.exit(0);
+}
+
 let entries: PreprocessEntry[] = []
 let config: PreprocessConfig = { numProcesses: 1, customProperties: void 0 }
 
-- 
GitLab