Sha256: 0b8fb7132fffcba2855a6ca5f035a27ad3ce58d1bed5d1b453303bb8c2071ad0

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

module Pytty
  module Client
    module Cli
      class RootCommand < Clamp::Command
        banner "🧻  pytty #{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 ["run"], "run", RunCommand
        subcommand ["stream"], "stream", StreamCommand
        subcommand ["yield"], "yield", YieldCommand
        subcommand ["ps"], "ps", PsCommand
        subcommand ["kill"], "kill", KillCommand
        subcommand ["rm"], "rm", RmCommand
        subcommand ["spawn"], "spawn", SpawnCommand
        subcommand ["signal"], "signal", SignalCommand
        subcommand ["attach"], "attach", AttachCommand

        def self.run
          super
        rescue StandardError => exc
          warn exc.message
          warn exc.backtrace.join("\n")
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pytty-0.3.0 lib/pytty/client/cli/root_command.rb