From 1175b6f8ce3f3529fb36ae1f486d1749166cadc8 Mon Sep 17 00:00:00 2001
From: Patrick Godwin <patrick.godwin@ligo.org>
Date: Thu, 12 Jul 2018 13:07:52 -0700
Subject: [PATCH] gstlal_feature_extractor execs: add usage kwarg to
 OptionParser so that command line options get rendered in online docs

---
 gstlal-burst/bin/gstlal_feature_extractor                 | 8 ++++----
 gstlal-burst/bin/gstlal_feature_extractor_pipe            | 2 +-
 .../bin/gstlal_feature_extractor_template_overlap         | 7 +++++--
 gstlal-burst/bin/gstlal_feature_extractor_whitener_check  | 5 ++++-
 gstlal-burst/bin/gstlal_ll_feature_extractor_pipe         | 2 +-
 5 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/gstlal-burst/bin/gstlal_feature_extractor b/gstlal-burst/bin/gstlal_feature_extractor
index 2950205975..3582b71fdb 100755
--- a/gstlal-burst/bin/gstlal_feature_extractor
+++ b/gstlal-burst/bin/gstlal_feature_extractor
@@ -16,7 +16,9 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
-
+"""
+A program to extract features from auxiliary channel data in real time or in offline mode
+"""
 
 # =============================
 # 
@@ -24,8 +26,6 @@
 #
 # =============================
 
-### A program to extract features from auxiliary channel data in real time or in offline mode
-###
 ### .. graphviz::
 ###
 ###    digraph llpipe {
@@ -192,7 +192,7 @@ setrlimit(resource.RLIMIT_STACK, 1024 * 1024) # 1 MiB per thread
 
 def parse_command_line():
 
-	parser = OptionParser(description = __doc__)
+	parser = OptionParser(usage = '%prog [options]', description = __doc__)
 
 	# First append datasource and feature extraction common options
 	multichannel_datasource.append_options(parser)
diff --git a/gstlal-burst/bin/gstlal_feature_extractor_pipe b/gstlal-burst/bin/gstlal_feature_extractor_pipe
index 71bc01c014..de863adbea 100755
--- a/gstlal-burst/bin/gstlal_feature_extractor_pipe
+++ b/gstlal-burst/bin/gstlal_feature_extractor_pipe
@@ -170,7 +170,7 @@ def feature_extractor_node_gen(gstlalFeatureExtractorJob, dag, parent_nodes, seg
 #
 
 def parse_command_line():
-	parser = OptionParser(description = __doc__)
+	parser = OptionParser(usage = '%prog [options]', description = __doc__)
 
 	# generic data source options
 	multichannel_datasource.append_options(parser)
diff --git a/gstlal-burst/bin/gstlal_feature_extractor_template_overlap b/gstlal-burst/bin/gstlal_feature_extractor_template_overlap
index 220ab60c50..de1d7a7643 100755
--- a/gstlal-burst/bin/gstlal_feature_extractor_template_overlap
+++ b/gstlal-burst/bin/gstlal_feature_extractor_template_overlap
@@ -16,7 +16,10 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
-
+"""
+A program that measures template overlaps and how templates are spread out in the parameter space
+for gstlal_feature_extractor
+"""
 
 ####################
 # 
@@ -206,7 +209,7 @@ def to_output_url(output_dir):
 
 def parse_command_line():
 
-	parser = OptionParser(description = __doc__)
+	parser = OptionParser(usage = '%prog [options]', description = __doc__)
 
 	parser.add_option("-v", "--verbose", action = "store_true", help = "Be verbose.")
 	parser.add_option("-m", "--mismatch", type = "float", default = 0.05, help = "Mismatch between templates, mismatch = 1 - minimal match. Default = 0.05.")
diff --git a/gstlal-burst/bin/gstlal_feature_extractor_whitener_check b/gstlal-burst/bin/gstlal_feature_extractor_whitener_check
index b732fbb945..15a25a244e 100755
--- a/gstlal-burst/bin/gstlal_feature_extractor_whitener_check
+++ b/gstlal-burst/bin/gstlal_feature_extractor_whitener_check
@@ -16,6 +16,9 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+"""
+A program that allows diagnosis of the whitening stage of gstlal_feature_extractor
+"""
 
 
 ####################
@@ -60,7 +63,7 @@ PSD_DROP_TIME = 16 * PSD_FFT_LENGTH
 
 def parse_command_line():
 
-	parser = OptionParser(description = __doc__)
+	parser = OptionParser(usage = '%prog [options]', description = __doc__)
 
 	# First append the datasource common options
 	multichannel_datasource.append_options(parser)
diff --git a/gstlal-burst/bin/gstlal_ll_feature_extractor_pipe b/gstlal-burst/bin/gstlal_ll_feature_extractor_pipe
index 4f742314d3..0d326e9e00 100755
--- a/gstlal-burst/bin/gstlal_ll_feature_extractor_pipe
+++ b/gstlal-burst/bin/gstlal_ll_feature_extractor_pipe
@@ -139,7 +139,7 @@ def feature_extractor_node_gen(feature_extractor_job, dag, parent_nodes, ifo, op
 # =============================
 
 def parse_command_line():
-	parser = optparse.OptionParser(description = __doc__)
+	parser = optparse.OptionParser(usage = '%prog [options]', description = __doc__)
 
 	# generic data source and feature extraction options
 	multichannel_datasource.append_options(parser)
-- 
GitLab