Skip to content

Commit 396dcad

Browse files
authored
merge(#29): adds support to debug flag
Adds support to debug flag
2 parents 1298c88 + 1d3cd4c commit 396dcad

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

generator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ def main(debug_mode=False):
6464
parser.print_help()
6565

6666

67-
debug_option = False
6867
parser = parser_cli()
6968
args = parser.parse_args()
70-
debug('args variable', args, debug_option)
71-
main(debug_option)
69+
debug('args variable', args, args.debug)
70+
main(args.debug)

utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ def parser_cli():
5050
"""
5151
parser = argparse.ArgumentParser(description=desc)
5252
parser.add_argument("--co-author",
53-
help="make your friend an co-author to the commit",
53+
help="Make your friend an co-author to the commit",
5454
dest="co_author", default='')
55-
parser.add_argument("--no-generate", dest="no_file",
56-
help="disables the creation of a commiter.yml file",
57-
default=False, type=bool)
55+
parser.add_argument("--no-file", dest="no_file",
56+
help="Disables the creation of a commiter.yml file",
57+
action="store_true")
5858
parser.add_argument("--convention", choices=supported_conventions,
5959
dest="convention", default='', help=help_convention)
60+
parser.add_argument('--debug', action="store_true", dest="debug",
61+
help="Toggles debug option")
6062
return parser
6163

6264

@@ -68,6 +70,4 @@ def change_if_none(string):
6870

6971
def debug(message, value, show=False):
7072
if show:
71-
print("\n-------DEBUG--------")
72-
print("%s: %s" % (message, value))
73-
print("--------END---------\n")
73+
print("DEBUG-> %s: %s" % (message, value))

0 commit comments

Comments
 (0)