1. set default option -h for tool [why] the tool will show help message if no option specified the tool will get no email address without both '-e' and '-f'
[how] add '-h' as default option if no option specified options will be reset to '-h' if both '-e' and '-f' are not specified
2. fix undefined method 'empty' [why] the original data is defined nil, but not empty for my_email when execute answerback-email with no -e or -f, it will throw error as: raceback (most recent call last): 2: from ./answerback-email.rb:213:in `<main>' 1: from ./answerback-email.rb:184:in `send_account' ./answerback-email.rb:155:in `check_my_email': undefined method `empty?' for nil:NilClass (NoMethodError)
Signed-off-by: Luan Shengde shdluan@163.com --- container/assign-account/answerback-email.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/assign-account/answerback-email.rb b/container/assign-account/answerback-email.rb index badbdea..874003e 100755 --- a/container/assign-account/answerback-email.rb +++ b/container/assign-account/answerback-email.rb @@ -219,4 +219,4 @@ def store_account_info(my_info) es.put_source_by_id(my_info['my_email'], my_info) end
-send_account(my_info, conf_info, email_info, my_info_es, stdin_info) +# send_account(my_info, conf_info, email_info, my_info_es, stdin_info)
pls ignore this
thanks
On Sat, Nov 28, 2020 at 12:03:35PM +0800, Luan Shengde wrote:
- set default option -h for tool
[why] the tool will show help message if no option specified the tool will get no email address without both '-e' and '-f'
[how] add '-h' as default option if no option specified options will be reset to '-h' if both '-e' and '-f' are not specified
- fix undefined method 'empty'
[why] the original data is defined nil, but not empty for my_email when execute answerback-email with no -e or -f, it will throw error as: raceback (most recent call last): 2: from ./answerback-email.rb:213:in `<main>' 1: from ./answerback-email.rb:184:in `send_account' ./answerback-email.rb:155:in `check_my_email': undefined method `empty?' for nil:NilClass (NoMethodError)
Signed-off-by: Luan Shengde shdluan@163.com
container/assign-account/answerback-email.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/assign-account/answerback-email.rb b/container/assign-account/answerback-email.rb index badbdea..874003e 100755 --- a/container/assign-account/answerback-email.rb +++ b/container/assign-account/answerback-email.rb @@ -219,4 +219,4 @@ def store_account_info(my_info) es.put_source_by_id(my_info['my_email'], my_info) end
-send_account(my_info, conf_info, email_info, my_info_es, stdin_info)
+# send_account(my_info, conf_info, email_info, my_info_es, stdin_info)
2.23.0