Sha256: d3cfa6f02504763e44cae166ab8f0de2c5b62941150bd7845bdcb800f20abc3e
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true require 'masking/config' require 'masking/errors' require 'masking/cli/error_message' require 'optparse' module Masking class Cli def initialize(argv) @argv = argv end def run option_parser.parse(argv) Masking.run rescue Masking::Error => error warn(Masking::Cli::ErrorMessage.new(error).message(config_file_path: Masking.config.target_columns_file_path)) exit(false) end private attr_reader :argv def option_parser OptionParser.new do |parser| parser.banner = 'Usage: masking [options]' define_config_option(parser) define_version_option(parser) end end def define_config_option(parser) parser.on('-cFILE_PATH', '--config=FILE_PATH', 'specify config file. default: masking.yml') do |file_path| Masking.configure do |config| config.target_columns_file_path = file_path end end end def define_version_option(parser) parser.on('-v', '--version', 'version') do puts Masking::VERSION exit(true) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
masking-1.0.0 | lib/masking/cli.rb |