Sha256: 17af561fd435142656bda9d33504514382da1af6160eea8f82cbd19e19b34946

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

require "thor"
require "active_support/core_ext/numeric/time.rb"
require "tlapse"
require "tlapse/cli/alpha"

module Tlapse::CLI
  class CLI < Thor
    desc "doctor", "Perform checks to see if you're ready to tlapse"
    def doctor
      Tlapse::Doctor.doctor
    end

    desc "version", "Print the version number and exit"
    def version
      puts Tlapse::VERSION
    end

    desc "capture", "Capture a single photo, saving it to the current directory"
    def capture
      Tlapse::Capture.capture_single
    end

    desc "until_sunset", "Generate a gphoto2 command to capture photos from now until the sun sets (useful for cronjobs)"
    option :interval,
      desc: "The interval (in minutes) at which picturs will be taken",
      type: :numeric,
      default: 5,
      aliases: %i(i)
    def until_sunset
      interval = options[:interval].minutes
      puts Tlapse::Capture.timelapse_command_while_sun_is_up(interval: interval)
    end

    desc "alpha", "Get early access to in-development (and likely unstable) commands"
    subcommand "alpha", Tlapse::CLI::Alpha
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tlapse-0.6.3 lib/tlapse/cli/cli.rb
tlapse-0.6.2 lib/tlapse/cli/cli.rb
tlapse-0.6.1 lib/tlapse/cli/cli.rb
tlapse-0.6.0 lib/tlapse/cli/cli.rb
tlapse-0.5.1 lib/tlapse/cli/cli.rb
tlapse-0.5.0 lib/tlapse/cli/cli.rb