Sha256: 919e6d35a3895b26c79a6d11fa0992d1052abeca674f01b01bad153eeb177d3c

Contents?: true

Size: 714 Bytes

Versions: 3

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true

module Pytty
  module Daemon
    module Cli
      class RootCommand < Clamp::Command
        banner "🚽 pyttyd #{Pytty::VERSION}"

        option ['-v', '--version'], :flag, "Show version information" do
          puts Pytty::VERSION
          exit 0
        end

        subcommand ["version"], "Show version information", Pytty::Common::Cli::VersionCommand
        subcommand ["serve"], "serve", ServeCommand

        def self.run
          if ARGV.size == 0
            ServeCommand.run
          else
            super
          end
        rescue StandardError => exc
          warn exc.message
          warn exc.backtrace.join("\n")
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pytty-0.5.0 lib/pytty/daemon/cli/root_command.rb
pytty-0.4.1 lib/pytty/daemon/cli/root_command.rb
pytty-0.4.0 lib/pytty/daemon/cli/root_command.rb