Sha256: 98764c737ca777ef5fe787fcee9fea6e5e813f90e9d35de606cb453135b73d06

Contents?: true

Size: 737 Bytes

Versions: 4

Compression:

Stored size: 737 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'isna'

options = {}

OptionParser.new do |opts|

  opts.banner = "Usage: #{$0} [OPTIONS]"

  opts.on('-f', '--file []', 'File with entries to be removed.') do |value|
    options[:file] = value
  end

end.parse!

required_options = [:file]
required_options.each do |option|
  unless options[option]
    $stderr.puts "Can not run #{option.to_s} was not given."
    exit 1
  end
end

unless File.exist?(options[:file])
  $stderr.puts "File #{options[:file]} does not exist."
  exit 1
end

inputs = []
entries = []


File.read(options[:file]).each_line do |line|
  entries << line
end

STDIN.each_line do |line|
  inputs << line
end

(inputs - entries).each do |item|
  puts item.chomp
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ix-cli-0.0.21 bin/ix-remove
ix-cli-0.0.20 bin/ix-remove
ix-cli-0.0.19 bin/ix-remove
ix-cli-0.0.18 bin/ix-remove