Commit f7746bd7 authored by Momme Butenschoen's avatar Momme Butenschoen

Print help string on empy file arguments rather than empty options.

parent c6c222f2
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
# !ROUTINE: PyProTex - Translates DAO Prologues to LaTeX # !ROUTINE: PyProTex - Translates DAO Prologues to LaTeX
# #
# !INTERFACE: # !INTERFACE:
# PyProTex.py [-hbgACFS] ] [+-nlsxf] [src_file(s)] # PyProTex.py [-hbgACFS] ] [+-nlsxf] src_file[s]
# #
# !DESCRIPTION: # !DESCRIPTION:
# This as a python version of the protex perl tool. # This as a python version of the protex perl tool.
...@@ -151,11 +151,6 @@ class PyProTex: ...@@ -151,11 +151,6 @@ class PyProTex:
"""Initiate class object with all options and settings. """Initiate class object with all options and settings.
Choices: PyProTex options as list of input strings in.""" Choices: PyProTex options as list of input strings in."""
# If no command line arguments are present print help string and exit
# ---------------------
if not Choices: self.print_help()
#Option Classes #Option Classes
self.GlobOptions=["h","b","g"] self.GlobOptions=["h","b","g"]
self.LangOptions=["A","C","F","S"] self.LangOptions=["A","C","F","S"]
...@@ -321,6 +316,11 @@ class PyProTex: ...@@ -321,6 +316,11 @@ class PyProTex:
compiling the documentation Tex source into the self.Str string compiling the documentation Tex source into the self.Str string
attribute. attribute.
files: list of input files""" files: list of input files"""
# If no file arguments are present print help string and exit
# ---------------------
if not files: self.print_help()
for f in files: for f in files:
# Set file name parameters # Set file name parameters
# ------------------------ # ------------------------
...@@ -887,7 +887,7 @@ class PyProTex: ...@@ -887,7 +887,7 @@ class PyProTex:
def print_help(self,dest=stdout): def print_help(self,dest=stdout):
"""Print help string, by default to standard output.""" """Print help string, by default to standard output."""
print("Usage: PyProTex.py [-hbACFS] [+-nlsxf] [src_file(s)]",file=dest) print("Usage: PyProTex.py [-hbACFS] [+-nlsxf] src_file[s]",file=dest)
print(" ",file=dest) print(" ",file=dest)
print(" Options:",file=dest) print(" Options:",file=dest)
print(" -h Human mode: descriptions only, no code information",file=dest) print(" -h Human mode: descriptions only, no code information",file=dest)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment