Sha256: 062ae9fbbb30679eb8f5d9487ca75d18c31122548ad9318ba45574637741afb0

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

# frozen_string_literal: true

module Pcli
  class Options
    class TTYOption
      include TTY::Option

      usage do
        program 'ponsqb'

        desc 'Launch the Ponsqb admin CLI.'
      end

      option :endpoint do
        short '-e'
        long '--endpoint string'
        default 'https://ponsqb.provisionsbs.com'
        desc 'Ponsqb endpoint.'
      end

      flag :help do
        short '-h'
        long '--help'
        desc 'Print usgae.'
      end

      def evaluate
        if params[:help]
          print help
          exit
        end

        params.to_h
      end
    end

    def self.parse(args)
      TTYOption.new.parse(args).evaluate
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pcli-0.1.1 lib/pcli/options.rb
pcli-0.1.0 lib/pcli/options.rb