summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Peveler <matt.peveler@gmail.com>2022-05-21 11:33:31 -0400
committerGitHub <noreply@github.com>2022-05-21 11:33:31 -0400
commit08e9d3ea795868f6b2df638b1211885e4533fb71 (patch)
treeb7e94f7f5af205d8eb5883e6a2ecee0c1c6811dd
parentb5fa601c312250a2c89a7a243c635dbfae71ab69 (diff)
downloadasciidoc-py3-08e9d3ea795868f6b2df638b1211885e4533fb71.tar.gz
Fix verbose flag not working when using a2x or asciidoc entry points (#252)
-rw-r--r--asciidoc/a2x.py2
-rw-r--r--asciidoc/asciidoc.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/asciidoc/a2x.py b/asciidoc/a2x.py
index 84a9334..9343288 100644
--- a/asciidoc/a2x.py
+++ b/asciidoc/a2x.py
@@ -1004,6 +1004,7 @@ def parse_args(argv):
def cli():
global OPTIONS
+ asciidoc.set_caller("__main__")
argv, opts, args = parse_args(sys.argv)
opts = eval(str(opts)) # Convert optparse.Values to dict.
a2x = A2X(opts)
@@ -1021,5 +1022,4 @@ def cli():
#####################################################################
if __name__ == "__main__":
- asciidoc.set_caller(__name__)
cli()
diff --git a/asciidoc/asciidoc.py b/asciidoc/asciidoc.py
index de79957..9d53b3d 100644
--- a/asciidoc/asciidoc.py
+++ b/asciidoc/asciidoc.py
@@ -9,7 +9,7 @@ Copyright (C) 2013-2022 AsciiDoc Contributors.
Free use of this software is granted under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -5864,6 +5864,7 @@ def execute(cmd, opts, args):
def cli(argv=None):
+ set_caller("__main__")
if argv is None:
argv = sys.argv
# Process command line options.