14
14
# bash version: 4.0 or higher
15
15
# credits: -
16
16
# license: MIT License
17
- version=0.3 .0
17
+ version=0.4 .0
18
18
19
19
20
20
@@ -1722,6 +1722,29 @@ tasker_config_utils_generate_config_info() {
1722
1722
i=$(( i + 1 ))
1723
1723
done
1724
1724
1725
+
1726
+
1727
+ # ##Add Text Description
1728
+
1729
+ # if text_description is set
1730
+ if [ ! -z " $text_description " ]; then
1731
+ text_description_info=$' \n\n\n\n \n ' " ## Description:" $' \n \n\n ' " $text_description " $' \n ##\n '
1732
+ else
1733
+ text_description_info=" "
1734
+ fi
1735
+
1736
+ # ##Add Code Description
1737
+
1738
+ # if code_description is set
1739
+ if [ ! -z " $code_description " ]; then
1740
+ code_description=" $( convert_string_to_markdown_code " code-block" " $code_description " ) "
1741
+ code_description_info=$' \n\n\n \n ' " ## Code Description:" $' \n \n\n ' " $code_description " $' \n\n ##\n \n '
1742
+ else
1743
+ code_description_info=" "
1744
+ fi
1745
+
1746
+
1747
+
1725
1748
tasker_config_utils_log_literal 1 " \n"
1726
1749
tasker_config_utils_log 1 " Writing All Info To Output File"
1727
1750
@@ -1766,6 +1789,7 @@ tasker_config_utils_generate_config_info() {
1766
1789
fi
1767
1790
1768
1791
exported_tasker_config_info_output+=" $export_info "
1792
+ [ ! -z " $text_description_info " ] && exported_tasker_config_info_output+=" $text_description_info "
1769
1793
exported_tasker_config_info_output+=$' \n\n '
1770
1794
exported_tasker_config_info_output+=" $profiles_name_list "
1771
1795
exported_tasker_config_info_output+=$' \n\n '
@@ -1776,6 +1800,7 @@ tasker_config_utils_generate_config_info() {
1776
1800
exported_tasker_config_info_output+=" $profiles_info_list "
1777
1801
exported_tasker_config_info_output+=$' \n\n '
1778
1802
exported_tasker_config_info_output+=" $tasks_info_list "
1803
+ [ ! -z " $code_description_info " ] && exported_tasker_config_info_output+=" $code_description_info "
1779
1804
1780
1805
# if add_script_signature_to_config_info is enabled
1781
1806
if [[ " $add_script_signature_to_config_info " == " 1" ]]; then
@@ -2268,6 +2293,24 @@ process_tasker_config_utils_parameters () {
2268
2293
tasker_config_utils_log_arg_errors " Invalid option or parameters not allowed for option: '--${OPTARG% =* } '"
2269
2294
exit_tasker_config_utils_on_error " $command_type "
2270
2295
;;
2296
+ code_description=?* )
2297
+ val=" $long_optargs "
2298
+ tasker_config_utils_log_args " Parsing option: '--${OPTARG% =* } ', value: '${val} '"
2299
+ code_description=" $( echo " $val " ) " # remove trailing newlines
2300
+ ;;
2301
+ code_description | code_description=)
2302
+ tasker_config_utils_log_arg_errors " No parameters set for option: '--${OPTARG% =* } '"
2303
+ exit_tasker_config_utils_on_error " $command_type "
2304
+ ;;
2305
+ text_description=?* )
2306
+ val=" $long_optargs "
2307
+ tasker_config_utils_log_args " Parsing option: '--${OPTARG% =* } ', value: '${val} '"
2308
+ text_description=" $( echo " $val " ) " # remove trailing newlines
2309
+ ;;
2310
+ text_description | text_description=)
2311
+ tasker_config_utils_log_arg_errors " No parameters set for option: '--${OPTARG% =* } '"
2312
+ exit_tasker_config_utils_on_error " $command_type "
2313
+ ;;
2271
2314
' ' ) # "--" terminates argument processing to support non-options that start with dashes
2272
2315
tasker_config_utils_log_args " Parsing option: '--'"
2273
2316
break
@@ -2431,6 +2474,7 @@ Available command_options:
2431
2474
post tag sed regex to match while
2432
2475
extracting tag
2433
2476
2477
+
2434
2478
tasker_config should be the path to a Tasker "Data Backup" XML
2435
2479
file. It must be an exported "Data Backup" and not an auto backup.
2436
2480
@@ -2630,6 +2674,11 @@ Available command_options:
2630
2674
[ -c ] put task help in a code block
2631
2675
[ -p ] extract info of a specific project
2632
2676
[ -s ] add script signature at end of config info file
2677
+ [ --text_description=<description> ]
2678
+ text description of config
2679
+ [ --code_description=<description> ]
2680
+ code description of config
2681
+
2633
2682
2634
2683
The options '-a' and '-p' set the generate_config_info_mode of the
2635
2684
generate_config_info command. One of them must be passed.
@@ -2659,7 +2708,14 @@ The '-c' option will surround the task help in a code block. By
2659
2708
default the help should be in markdown format.
2660
2709
2661
2710
The '-s' option will add a script signature containing a link to the
2662
- script repo at the end.
2711
+ script repo at the end.
2712
+
2713
+ The string passed with the '--text_description' option will be added
2714
+ under the 'Description' heading at the start.
2715
+
2716
+ The string passed with the '--code_description' option will be added
2717
+ under the 'Code Description' heading at the end in a markdown code
2718
+ block.
2663
2719
2664
2720
Set verbose level to 1 or 2 to get more info when running
2665
2721
tasker_config_utils generate_config_info command.
0 commit comments