On Thu, Dec 03, 2020 at 11:17:38AM +0800, Lu Weitao wrote:
On Thu, Dec 03, 2020 at 10:36:53AM +0800, Wang Chenglong wrote:
On Thu, Dec 03, 2020 at 10:26:20AM +0800, Lu Weitao wrote:
[Why] It's more friendly to user that command-line tool have a help option
Signed-off-by: Lu Weitao luweitaobe@163.com
sbin/mail-job | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/sbin/mail-job b/sbin/mail-job index 954c149..85e37a1 100755 --- a/sbin/mail-job +++ b/sbin/mail-job @@ -3,11 +3,32 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
-# Usage: -# mail-job job_id
+require 'optparse' require_relative '../lib/mail_job_result.rb'
Maybe it's better to use absolute paths.
require_relative '../lib/mail_job_result.rb' require 'ENV[CCI_SRC]/lib/mail_job_result.rb' have same effect
So that's it. Learning it.
Thanks, Chenglong
Thanks, Weitao
Thanks, Chenglong
-job_id = ARGV[0]