Skip to content

Commit c44b361

Browse files
## [0.4.0] - 2020-11-09
### Added - Added support for text and code descriptions for `generate_config_info` command using `--text_description` and `--code_description` options.
1 parent dfe8916 commit c44b361

File tree

3 files changed

+80
-4
lines changed

3 files changed

+80
-4
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ All notable changes to this project will be documented in this file.
2020
`-`
2121

2222

23+
## [0.4.0] - 2020-11-09
24+
25+
### Added
26+
- Added support for text and code descriptions for `generate_config_info` command using `--text_description` and `--code_description` options.
27+
28+
2329
## [0.3.0] - 2020-11-06
2430

2531
### Added
@@ -57,7 +63,8 @@ All notable changes to this project will be documented in this file.
5763
##
5864

5965

60-
[unreleased]: https://github.com/Taskomater/tasker_config_utils/compare/v0.3.0...HEAD
66+
[unreleased]: https://github.com/Taskomater/tasker_config_utils/compare/v0.4.0...HEAD
67+
[0.3.0]: https://github.com/Taskomater/tasker_config_utils/compare/v0.3.0...v0.4.0
6168
[0.3.0]: https://github.com/Taskomater/tasker_config_utils/compare/v0.2.2...v0.3.0
6269
[0.2.2]: https://github.com/Taskomater/tasker_config_utils/compare/v0.2.1...v0.2.2
6370
[0.2.1]: https://github.com/Taskomater/tasker_config_utils/compare/v0.2.0...v0.2.1

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This is a project that provides bash util script(s) to extract information and m
4141

4242
### Downloads
4343

44-
Latest version is `v0.3.0`.
44+
Latest version is `v0.4.0`.
4545

4646
- [GitHub releases](https://github.com/Taskomater/tasker_config_utils/releases).
4747
##
@@ -161,6 +161,7 @@ Available command_options:
161161
post tag sed regex to match while
162162
extracting tag
163163
164+
164165
tasker_config should be the path to a Tasker "Data Backup" XML
165166
file. It must be an exported "Data Backup" and not an auto backup.
166167
@@ -361,6 +362,11 @@ Available command_options:
361362
[ -c ] put task help in a code block
362363
[ -p ] extract info of a specific project
363364
[ -s ] add script signature at end of config info file
365+
[ --text_description=<description> ]
366+
text description of config
367+
[ --code_description=<description> ]
368+
code description of config
369+
364370
365371
The options '-a' and '-p' set the generate_config_info_mode of the
366372
generate_config_info command. One of them must be passed.
@@ -392,6 +398,13 @@ default the help should be in markdown format.
392398
The '-s' option will add a script signature containing a link to the
393399
script repo at the end.
394400
401+
The string passed with the '--text_description' option will be added
402+
under the 'Description' heading at the start.
403+
404+
The string passed with the '--code_description' option will be added
405+
under the 'Code Description' heading at the end in a markdown code
406+
block.
407+
395408
Set verbose level to 1 or 2 to get more info when running
396409
tasker_config_utils generate_config_info command.
397410

tasker_config_utils

+58-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
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&nbsp;\n'"## Description:"$'\n&nbsp;\n\n'"$text_description"$'\n##\n&nbsp;'
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&nbsp;\n'"## Code Description:"$'\n&nbsp;\n\n'"$code_description"$'\n\n##\n&nbsp;\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+
24342478
tasker_config should be the path to a Tasker "Data Backup" XML
24352479
file. 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
26342683
The options '-a' and '-p' set the generate_config_info_mode of the
26352684
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
26592708
default the help should be in markdown format.
26602709
26612710
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.
26632719
26642720
Set verbose level to 1 or 2 to get more info when running
26652721
tasker_config_utils generate_config_info command.

0 commit comments

Comments
 (0)