lib/remocon/cli.rb in remocon-0.1.0 vs lib/remocon/cli.rb in remocon-0.2.0
- old
+ new
@@ -1,41 +1,53 @@
# frozen_string_literal: true
module Remocon
class CLI < ::Thor
- desc 'create', 'Create a json to be pushed'
- option :parameters, type: :string, required: true, desc: 'a filepath of parameters file'
- option :conditions, type: :string, required: true, desc: 'a filepath of conditions file'
- option :dest, type: :string, desc: 'a filepath or directory path of destination'
+ desc "create", "Create a json to be pushed"
+ option :parameters, type: :string, desc: "Specify the filepath if you want to use a custom parameters file"
+ option :conditions, type: :string, desc: "Specify the filepath if you want to use a custom conditions file"
+ option :prefix, type: :string, desc: "the directory name which will contain project-related files"
+ option :id, type: :string, desc: "your project"
+ option :dest, type: :string, hide: true, desc: "[Deprecated] the same with --prefix"
def create
execute(Remocon::Command::Create)
end
- desc 'push', 'Upload remote configs based on a source json file'
- class_option :source, type: :string, desc: 'a filepath of a source json file'
- option :etag, type: :string, desc: 'a filepath or raw value of etag'
- option :dest, type: :string, desc: 'a filepath or directory path of destination'
- option :force, type: :boolean, default: false, desc: 'force to ignore some warnings'
+ desc "push", "Upload remote configs based on a source json file"
+ option :source, type: :string, desc: "the filepath of your config json file"
+ option :etag, type: :string, desc: "the file path of etag"
+ option :raw_etag, type: :string, desc: "the raw value of etag"
+ option :prefix, type: :string, desc: "the directory name which will contain project-related files"
+ option :force, type: :boolean, default: false, desc: "force to ignore some warnings"
+ option :token, type: :string, desc: "access token to your project"
+ option :id, type: :string, desc: "your project id"
+ option :dest, type: :string, hide: true, desc: "[Deprecated] the same with --prefix"
def push
execute(Remocon::Command::Push)
end
- desc 'pull', 'Pull remote configs'
- option :dest, type: :string, desc: 'a filepath or directory path of destination'
+ desc "pull", "Pull remote configs"
+ option :prefix, type: :string, desc: "the directory name which will contain project-related files"
+ option :token, type: :string, desc: "access token to your project"
+ option :id, type: :string, desc: "your project id"
+ option :dest, type: :string, hide: true, desc: "[Deprecated] the same with --prefix"
def pull
execute(Remocon::Command::Pull)
end
- desc 'validate', 'Validate yml files'
- option :parameters, type: :string, required: true, desc: 'a filepath of parameters file'
- option :conditions, type: :string, required: true, desc: 'a filepath of conditions file'
+ desc "validate", "Validate yml files"
+ option :parameters, type: :string, desc: "Specify the filepath if you want to use a custom parameters file"
+ option :conditions, type: :string, desc: "Specify the filepath if you want to use a custom conditions file"
+ option :prefix, type: :string, desc: "the directory name which will contain project-related files"
+ option :id, type: :string, desc: "your project id"
+ option :token, type: :string, desc: "access token to your project"
def validate
execute(Remocon::Command::Validate)
end
private
def execute(klass)
- klass.new(options).run
+ exit(1) unless klass.new(options).run
end
end
end