Sha256: fe3e89322974082a6bd9c24aaf8606981651ea844601bc62f1762c3a98c3cf6d

Contents?: true

Size: 551 Bytes

Versions: 4

Compression:

Stored size: 551 Bytes

Contents

# frozen_string_literal: true

module Command
  class Exists < Base
    NAME = "exists"
    OPTIONS = [
      app_option(required: true)
    ].freeze
    DESCRIPTION = "Shell-checks if an application (GVC) exists, useful in scripts"
    LONG_DESCRIPTION = <<~DESC
      - Shell-checks if an application (GVC) exists, useful in scripts, e.g.:
    DESC
    EXAMPLES = <<~EX
      ```sh
      if [ cpl exists -a $APP_NAME ]; ...
      ```
    EX

    def call
      exit(cp.fetch_gvc.nil? ? ExitCode::ERROR_DEFAULT : ExitCode::SUCCESS)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cpl-2.2.4 lib/command/exists.rb
cpl-2.2.2 lib/command/exists.rb
cpl-2.2.1 lib/command/exists.rb
cpl-2.2.0 lib/command/exists.rb