[hawkmoth] [PATCH 8/8] hawkmoth: deprecate the cli tool for anything other than debug

  • From: Jani Nikula <jani@xxxxxxxxxx>
  • To: hawkmoth@xxxxxxxxxxxxx
  • Date: Thu, 13 Dec 2018 23:11:33 +0200

With the test usage for the Hawkmoth cli tool gone, there's no point in
maintaining it for anything other than debugging. It's still useful for
that, but allow more flexibility (e.g. change the output on a whim if
needed) by repurposing it as a debug-only tool. Focus on the Sphinx
extension being the main purpose of the project.

Remove cli part from the main documentation accordingly, and update the
cli argument parser documentation.
---
 doc/cli.rst          | 51 --------------------------------------------
 doc/index.rst        |  1 -
 hawkmoth/hawkmoth.py | 14 +++++++-----
 3 files changed, 9 insertions(+), 57 deletions(-)
 delete mode 100644 doc/cli.rst

diff --git a/doc/cli.rst b/doc/cli.rst
deleted file mode 100644
index efa73a69cf52..000000000000
--- a/doc/cli.rst
+++ /dev/null
@@ -1,51 +0,0 @@
-Command-Line Interface
-======================
-
-Synopsis
---------
-
-**hawkmoth.py** [options] FILE
-
-Description
------------
-
-In addition to the extension, Hawkmoth provides a command-line interface to the
-parser, independent of Sphinx. This is used mainly for automated testing of the
-parser parts.
-
-**hawkmoth.py** prints the documentation comments extracted from FILE, along
-with the generated C Domain directives, to standard output.
-
-Supported options for **hawkmoth.py** include:
-
-.. program:: hawkmoth.py
-
-.. option:: FILE
-
-   The C source or header file to parse.
-
-.. option:: --compat=<option>
-
-   Compatibility option. One of ``none`` (the default), ``javadoc-basic``,
-   ``javadoc-liberal``, and ``kernel-doc``. This can be used to perform a
-   limited conversion of Javadoc-style tags to reStructuredText.
-
-.. option:: --clang=<params>
-
-   A comma separated list of arguments to pass to ``clang`` while parsing the
-   source, typically to define macros for conditional compilation, for example
-   ``--clang=-DFOO=1,-DBAR=2``. No additional arguments are passed by default.
-
-.. option:: -h
-
-   Print help.
-
-Exit Status
------------
-
-0 on success.
-
-See Also
---------
-
-**clang(1)**
diff --git a/doc/index.rst b/doc/index.rst
index d696cd52ac2d..6727f470d999 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -10,7 +10,6 @@ Contents:
    extension
    syntax
    examples
-   cli
 
 Indices and tables
 ==================
diff --git a/hawkmoth/hawkmoth.py b/hawkmoth/hawkmoth.py
index aacb957f2981..21c29e811a20 100755
--- a/hawkmoth/hawkmoth.py
+++ b/hawkmoth/hawkmoth.py
@@ -359,18 +359,22 @@ def parse_to_string(filename, verbose, **options):
     return s
 
 def main():
-    parser = argparse.ArgumentParser(description='Hawkmoth.')
+    parser = argparse.ArgumentParser(description="""
+    Hawkmoth parser debug tool. Print the documentation comments extracted
+    from FILE, along with the generated C Domain directives, to standard
+    output. Include metadata with verbose output.""")
     parser.add_argument('file', metavar='FILE', type=str, action='store',
-                        help='tiedosto')
+                        help='The C source or header file to parse.')
     parser.add_argument('--compat',
                         choices=['none',
                                  'javadoc-basic',
                                  'javadoc-liberal',
                                  'kernel-doc'],
-                        help='compatibility options')
-    parser.add_argument('--clang', metavar='PARAM[,PARAM,...]')
+                        help='Compatibility options. See cautodoc_compat.')
+    parser.add_argument('--clang', metavar='PARAM[,PARAM,...]',
+                        help='Arguments to pass to clang. See cautodoc_clang.')
     parser.add_argument('--verbose', dest='verbose', action='store_true',
-                        help='verbose output')
+                        help='Verbose output.')
     args = parser.parse_args()
 
     filename = args.file
-- 
2.19.2


Other related posts:

  • » [hawkmoth] [PATCH 8/8] hawkmoth: deprecate the cli tool for anything other than debug - Jani Nikula