From 8dc742559675955e2c26c4fb7e7ed80932c5c09f Mon Sep 17 00:00:00 2001 From: "Brian D. Burns" Date: Thu, 28 Feb 2013 16:44:46 -0500 Subject: [PATCH] add `-t` alias for `backup generate:model --trigger` --- lib/backup/cli.rb | 2 +- spec/cli_spec.rb | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/backup/cli.rb b/lib/backup/cli.rb index 6cba04efa..969008d73 100644 --- a/lib/backup/cli.rb +++ b/lib/backup/cli.rb @@ -147,7 +147,7 @@ def perform "\s\sThe model file will be created as '/models/.rb'\n\n" + "\s\sDefault: #{Config.root_path}\n\n" - method_option :trigger, :type => :string, :required => true + method_option :trigger, :type => :string, :required => true, :aliases => '-t' method_option :config_path, :type => :string, :desc => 'Path to your Backup configuration directory' diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index 7e365b201..8eb057dfe 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -461,19 +461,19 @@ it 'should generate the proper help output' do - expected_usage = "#{ File.basename($0) } generate:model --trigger=TRIGGER" + expected_usage = "#{ File.basename($0) } generate:model -t, --trigger=TRIGGER" expected_options = <<-EOS - --trigger=TRIGGER - [--config-path=CONFIG_PATH] # Path to your Backup configuration directory - [--databases=DATABASES] # (mongodb, mysql, postgresql, redis, riak) - [--storages=STORAGES] # (cloud_files, dropbox, ftp, local, ninefold, rsync, s3, scp, sftp) - [--syncers=SYNCERS] # (cloud_files, rsync_local, rsync_pull, rsync_push, s3) - [--encryptors=ENCRYPTORS] # (gpg, openssl) - [--compressors=COMPRESSORS] # (bzip2, custom, gzip, lzma, pbzip2) - [--notifiers=NOTIFIERS] # (campfire, hipchat, mail, prowl, pushover, twitter) - [--archives] - [--splitter] # use `--no-splitter` to disable - # Default: true + -t, --trigger=TRIGGER + [--config-path=CONFIG_PATH] # Path to your Backup configuration directory + [--databases=DATABASES] # (mongodb, mysql, postgresql, redis, riak) + [--storages=STORAGES] # (cloud_files, dropbox, ftp, local, ninefold, rsync, s3, scp, sftp) + [--syncers=SYNCERS] # (cloud_files, rsync_local, rsync_pull, rsync_push, s3) + [--encryptors=ENCRYPTORS] # (gpg, openssl) + [--compressors=COMPRESSORS] # (bzip2, custom, gzip, lzma, pbzip2) + [--notifiers=NOTIFIERS] # (campfire, hipchat, mail, prowl, pushover, twitter) + [--archives] + [--splitter] # use `--no-splitter` to disable + # Default: true EOS expected_description = <<-EOS Generates a Backup model file.