1414# bash version: 4.0 or higher
1515# credits: -
1616# license: MIT License
17- version=0.3 .0
17+ version=0.4 .0
1818
1919
2020
@@ -1722,6 +1722,29 @@ tasker_config_utils_generate_config_info() {
17221722 i=$(( i + 1 ))
17231723 done
17241724
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+
17251748 tasker_config_utils_log_literal 1 " \n"
17261749 tasker_config_utils_log 1 " Writing All Info To Output File"
17271750
@@ -1766,6 +1789,7 @@ tasker_config_utils_generate_config_info() {
17661789 fi
17671790
17681791 exported_tasker_config_info_output+=" $export_info "
1792+ [ ! -z " $text_description_info " ] && exported_tasker_config_info_output+=" $text_description_info "
17691793 exported_tasker_config_info_output+=$' \n\n '
17701794 exported_tasker_config_info_output+=" $profiles_name_list "
17711795 exported_tasker_config_info_output+=$' \n\n '
@@ -1776,6 +1800,7 @@ tasker_config_utils_generate_config_info() {
17761800 exported_tasker_config_info_output+=" $profiles_info_list "
17771801 exported_tasker_config_info_output+=$' \n\n '
17781802 exported_tasker_config_info_output+=" $tasks_info_list "
1803+ [ ! -z " $code_description_info " ] && exported_tasker_config_info_output+=" $code_description_info "
17791804
17801805 # if add_script_signature_to_config_info is enabled
17811806 if [[ " $add_script_signature_to_config_info " == " 1" ]]; then
@@ -2268,6 +2293,24 @@ process_tasker_config_utils_parameters () {
22682293 tasker_config_utils_log_arg_errors " Invalid option or parameters not allowed for option: '--${OPTARG% =* } '"
22692294 exit_tasker_config_utils_on_error " $command_type "
22702295 ;;
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+ ;;
22712314 ' ' ) # "--" terminates argument processing to support non-options that start with dashes
22722315 tasker_config_utils_log_args " Parsing option: '--'"
22732316 break
@@ -2431,6 +2474,7 @@ Available command_options:
24312474 post tag sed regex to match while
24322475 extracting tag
24332476
2477+
24342478tasker_config should be the path to a Tasker "Data Backup" XML
24352479file. It must be an exported "Data Backup" and not an auto backup.
24362480
@@ -2630,6 +2674,11 @@ Available command_options:
26302674 [ -c ] put task help in a code block
26312675 [ -p ] extract info of a specific project
26322676 [ -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+
26332682
26342683The options '-a' and '-p' set the generate_config_info_mode of the
26352684generate_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
26592708default the help should be in markdown format.
26602709
26612710The '-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.
26632719
26642720Set verbose level to 1 or 2 to get more info when running
26652721tasker_config_utils generate_config_info command.
0 commit comments