Skip to content

Commit

Permalink
## [0.4.0] - 2020-11-09
Browse files Browse the repository at this point in the history
### Added
- Added support for text and code descriptions for `generate_config_info` command using `--text_description` and `--code_description` options.
  • Loading branch information
agnostic-apollo committed Nov 9, 2020
1 parent dfe8916 commit c44b361
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ All notable changes to this project will be documented in this file.
`-`


## [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.


## [0.3.0] - 2020-11-06

### Added
Expand Down Expand Up @@ -57,7 +63,8 @@ All notable changes to this project will be documented in this file.
##


[unreleased]: https://github.com/Taskomater/tasker_config_utils/compare/v0.3.0...HEAD
[unreleased]: https://github.com/Taskomater/tasker_config_utils/compare/v0.4.0...HEAD
[0.3.0]: https://github.com/Taskomater/tasker_config_utils/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/Taskomater/tasker_config_utils/compare/v0.2.2...v0.3.0
[0.2.2]: https://github.com/Taskomater/tasker_config_utils/compare/v0.2.1...v0.2.2
[0.2.1]: https://github.com/Taskomater/tasker_config_utils/compare/v0.2.0...v0.2.1
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This is a project that provides bash util script(s) to extract information and m

### Downloads

Latest version is `v0.3.0`.
Latest version is `v0.4.0`.

- [GitHub releases](https://github.com/Taskomater/tasker_config_utils/releases).
##
Expand Down Expand Up @@ -161,6 +161,7 @@ Available command_options:
post tag sed regex to match while
extracting tag
tasker_config should be the path to a Tasker "Data Backup" XML
file. It must be an exported "Data Backup" and not an auto backup.
Expand Down Expand Up @@ -361,6 +362,11 @@ Available command_options:
[ -c ] put task help in a code block
[ -p ] extract info of a specific project
[ -s ] add script signature at end of config info file
[ --text_description=<description> ]
text description of config
[ --code_description=<description> ]
code description of config
The options '-a' and '-p' set the generate_config_info_mode of the
generate_config_info command. One of them must be passed.
Expand Down Expand Up @@ -392,6 +398,13 @@ default the help should be in markdown format.
The '-s' option will add a script signature containing a link to the
script repo at the end.
The string passed with the '--text_description' option will be added
under the 'Description' heading at the start.
The string passed with the '--code_description' option will be added
under the 'Code Description' heading at the end in a markdown code
block.
Set verbose level to 1 or 2 to get more info when running
tasker_config_utils generate_config_info command.
Expand Down
60 changes: 58 additions & 2 deletions tasker_config_utils
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#bash version: 4.0 or higher
#credits: -
#license: MIT License
version=0.3.0
version=0.4.0



Expand Down Expand Up @@ -1722,6 +1722,29 @@ tasker_config_utils_generate_config_info() {
i=$(( i + 1 ))
done



###Add Text Description

#if text_description is set
if [ ! -z "$text_description" ]; then
text_description_info=$'\n\n\n\n&nbsp;\n'"## Description:"$'\n&nbsp;\n\n'"$text_description"$'\n##\n&nbsp;'
else
text_description_info=""
fi

###Add Code Description

#if code_description is set
if [ ! -z "$code_description" ]; then
code_description="$(convert_string_to_markdown_code "code-block" "$code_description")"
code_description_info=$'\n\n\n&nbsp;\n'"## Code Description:"$'\n&nbsp;\n\n'"$code_description"$'\n\n##\n&nbsp;\n'
else
code_description_info=""
fi



tasker_config_utils_log_literal 1 "\n"
tasker_config_utils_log 1 "Writing All Info To Output File"

Expand Down Expand Up @@ -1766,6 +1789,7 @@ tasker_config_utils_generate_config_info() {
fi

exported_tasker_config_info_output+="$export_info"
[ ! -z "$text_description_info" ] && exported_tasker_config_info_output+="$text_description_info"
exported_tasker_config_info_output+=$'\n\n'
exported_tasker_config_info_output+="$profiles_name_list"
exported_tasker_config_info_output+=$'\n\n'
Expand All @@ -1776,6 +1800,7 @@ tasker_config_utils_generate_config_info() {
exported_tasker_config_info_output+="$profiles_info_list"
exported_tasker_config_info_output+=$'\n\n'
exported_tasker_config_info_output+="$tasks_info_list"
[ ! -z "$code_description_info" ] && exported_tasker_config_info_output+="$code_description_info"

#if add_script_signature_to_config_info is enabled
if [[ "$add_script_signature_to_config_info" == "1" ]]; then
Expand Down Expand Up @@ -2268,6 +2293,24 @@ process_tasker_config_utils_parameters () {
tasker_config_utils_log_arg_errors "Invalid option or parameters not allowed for option: '--${OPTARG%=*}'"
exit_tasker_config_utils_on_error "$command_type"
;;
code_description=?*)
val="$long_optargs"
tasker_config_utils_log_args "Parsing option: '--${OPTARG%=*}', value: '${val}'"
code_description="$(echo "$val")" #remove trailing newlines
;;
code_description | code_description=)
tasker_config_utils_log_arg_errors "No parameters set for option: '--${OPTARG%=*}'"
exit_tasker_config_utils_on_error "$command_type"
;;
text_description=?*)
val="$long_optargs"
tasker_config_utils_log_args "Parsing option: '--${OPTARG%=*}', value: '${val}'"
text_description="$(echo "$val")" #remove trailing newlines
;;
text_description | text_description=)
tasker_config_utils_log_arg_errors "No parameters set for option: '--${OPTARG%=*}'"
exit_tasker_config_utils_on_error "$command_type"
;;
'' ) #"--" terminates argument processing to support non-options that start with dashes
tasker_config_utils_log_args "Parsing option: '--'"
break
Expand Down Expand Up @@ -2431,6 +2474,7 @@ Available command_options:
post tag sed regex to match while
extracting tag
tasker_config should be the path to a Tasker "Data Backup" XML
file. It must be an exported "Data Backup" and not an auto backup.
Expand Down Expand Up @@ -2630,6 +2674,11 @@ Available command_options:
[ -c ] put task help in a code block
[ -p ] extract info of a specific project
[ -s ] add script signature at end of config info file
[ --text_description=<description> ]
text description of config
[ --code_description=<description> ]
code description of config
The options '-a' and '-p' set the generate_config_info_mode of the
generate_config_info command. One of them must be passed.
Expand Down Expand Up @@ -2659,7 +2708,14 @@ The '-c' option will surround the task help in a code block. By
default the help should be in markdown format.
The '-s' option will add a script signature containing a link to the
script repo at the end.
script repo at the end.
The string passed with the '--text_description' option will be added
under the 'Description' heading at the start.
The string passed with the '--code_description' option will be added
under the 'Code Description' heading at the end in a markdown code
block.
Set verbose level to 1 or 2 to get more info when running
tasker_config_utils generate_config_info command.
Expand Down

0 comments on commit c44b361

Please sign in to comment.