66
77@click .command ()
88@click .option (
9- '--text' ,
9+ '-t' , '- -text' ,
1010 help = 'Input text directly for processing.'
1111 )
1212@click .option (
1515 help = 'Path to a file to read input from.'
1616 )
1717@click .option (
18- '--file' ,
18+ '-f' , '- -file' ,
1919 is_flag = True ,
2020 help = 'This option is under construction.'
2121 )
2424 is_flag = True ,
2525 help = 'Enable custom animation-style print for the output.'
2626 )
27+ @click .option (
28+ '-d' , '--debug' ,
29+ is_flag = True ,
30+ help = 'Enable Debugging - Printing the intermediate steps'
31+ )
2732
28- def main (text , text_from_file , file , animation ):
33+ def main (text , text_from_file , file , animation , debug ):
2934 if file :
3035 click .echo ("The '--file' option is under construction." )
3136 return
@@ -40,28 +45,29 @@ def main(text, text_from_file, file, animation):
4045 return
4146
4247 padded_input_string = InputPadder (input_string ).pad_input ()
43-
44- if animation :
45- custom_printer = CustomPrint (f"\n \033 [33mPadded Input String: \033 [0m\033 [36m{ padded_input_string } \033 [0m" )
46- custom_printer .custom_print ()
47- else :
48- click .echo (f"\n Padded Input String: { padded_input_string } " )
49-
48+ if debug :
49+ if animation :
50+ custom_printer = CustomPrint (f"\n \033 [33mPadded Input String: \033 [0m\033 [36m{ padded_input_string } \033 [0m" )
51+ custom_printer .custom_print ()
52+ else :
53+ click .echo (f"\n \033 [33mPadded Input String: \033 [0m \033 [36m { padded_input_string } \033 [0m " )
54+
5055 expanded_message_schedule = InputParser (padded_input_string ).process_chunks ()
51-
52- if animation :
53- custom_printer .text = f"\n \033 [33mExpanded Message Schedule: \033 [0m\033 [36m{ expanded_message_schedule } \033 [0m"
54- custom_printer .custom_print ()
55- else :
56- click .echo (f"\n Expanded Message Schedule: { expanded_message_schedule } " )
57-
56+
57+ if debug :
58+ if animation :
59+ custom_printer .text = f"\n \033 [33mExpanded Message Schedule: \033 [0m\033 [36m{ expanded_message_schedule } \033 [0m"
60+ custom_printer .custom_print ()
61+ else :
62+ click .echo (f"\n \033 [33mExpanded Message Schedule: \033 [0m\033 [36m{ expanded_message_schedule } \033 [0m" )
63+
5864 hash_result = MainClass (expanded_message_schedule ).hash_message ()
59-
65+
6066 if animation :
6167 custom_printer .text = f"\n \033 [33mThe Hash Result: \033 [0m\033 [36m{ hash_result } \033 [0m"
6268 custom_printer .custom_print ()
6369 else :
64- click .echo (f"\n The Hash Result: { hash_result } " )
70+ click .echo (f"\n \033 [33mThe Hash Result: \033 [0m \033 [36m { hash_result } \033 [0m " )
6571
6672if __name__ == '__main__' :
6773 main ()
0 commit comments