6
6
7
7
@click .command ()
8
8
@click .option (
9
- '--text' ,
9
+ '-t' , '- -text' ,
10
10
help = 'Input text directly for processing.'
11
11
)
12
12
@click .option (
15
15
help = 'Path to a file to read input from.'
16
16
)
17
17
@click .option (
18
- '--file' ,
18
+ '-f' , '- -file' ,
19
19
is_flag = True ,
20
20
help = 'This option is under construction.'
21
21
)
24
24
is_flag = True ,
25
25
help = 'Enable custom animation-style print for the output.'
26
26
)
27
+ @click .option (
28
+ '-d' , '--debug' ,
29
+ is_flag = True ,
30
+ help = 'Enable Debugging - Printing the intermediate steps'
31
+ )
27
32
28
- def main (text , text_from_file , file , animation ):
33
+ def main (text , text_from_file , file , animation , debug ):
29
34
if file :
30
35
click .echo ("The '--file' option is under construction." )
31
36
return
@@ -40,28 +45,29 @@ def main(text, text_from_file, file, animation):
40
45
return
41
46
42
47
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
+
50
55
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
+
58
64
hash_result = MainClass (expanded_message_schedule ).hash_message ()
59
-
65
+
60
66
if animation :
61
67
custom_printer .text = f"\n \033 [33mThe Hash Result: \033 [0m\033 [36m{ hash_result } \033 [0m"
62
68
custom_printer .custom_print ()
63
69
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 " )
65
71
66
72
if __name__ == '__main__' :
67
73
main ()
0 commit comments