when input single task_id, should use "<< task_id" not "<< [task_id]"
Signed-off-by: Tong Qunfeng taxcom@tom.com --- user-client/helper/redis_op_gc/delete_task.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/user-client/helper/redis_op_gc/delete_task.rb b/user-client/helper/redis_op_gc/delete_task.rb index 643d2b3..6534f95 100755 --- a/user-client/helper/redis_op_gc/delete_task.rb +++ b/user-client/helper/redis_op_gc/delete_task.rb @@ -6,17 +6,21 @@
require_relative './force_delete'
-if ARGV.empty? +if ARGV.empty? || ARGV.include?("-h") || ARGV.include?("--help") puts "Usage: #{__FILE__} task_id[|task_ids]" puts ' delete special task with [task_id]' - puts ' or delete special task form a [task_ids] file' + puts ' or delete special task from [task_ids] file' + puts "\n--- example ---" + puts " input: #{__FILE__} z9.11734 nolab.11342" + puts 'output: <none>' + puts ' # delete (z9.11734 nolab.11342) at taskqueue and scheduler' exit end
task_ids = [] ARGV.each do |id| task_ids += IO.readlines(id) if File.exist?(id) - task_ids << [id] unless File.exist?(id) + task_ids << id unless File.exist?(id) end
i = 0