Class: CMDB::Commands::Help

Inherits:
Object
  • Object
show all
Defined in:
lib/cmdb/commands/help.rb

Class Method Summary collapse

Class Method Details

.createObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/cmdb/commands/help.rb', line 6

def self.create
  options = Trollop.options do
    banner "The 'shim' command adapts your applications for use with CMDB without coupling them to\nthe CMDB RubyGem (or forcing you to write your applications in Ruby). It works by\nmanipulating the environment or filesystem to make CMDB inputs visible, then invoking\nyour app.\n\nTo use the shim with apps that read configuration from the filesystem, use the --dir\noption to tell the shim where to rewrite configuration files. It will look for tokens\nin JSON or YML that look like <<cmdb.key.name>> and replace them with the value of\nthe specified key.\n\nTo use the shim with 12-factor apps, use the --env option to tell the shim to load\nevery CMDB key into the environment. When using --env, the prefix of each key is\nomitted from the environment variable name, e.g. \"common.database.host\" is\nrepresented as DATABASE_HOST.\n\nTo support \"development mode\" and reload your app whenever its files change on disk,\nuse the --reload option and specify the name of a CMDB key that will enable this\nbehavior.\n\nUsage:\ncmdb shim [options] -- <command_to_exec> [options_for_command]\n\nWhere [options] are selected from:\n    EOS\n    opt :dir,\n        \"Directory to scan for key-replacement tokens in data files\",\n        :type => :string\n    opt :consul_url,\n        \"The URL for talking to consul\",\n        :type => :string\n    opt :consul_prefix,\n        \"The prefix to use when getting keys from consul, can be specified more than once\",\n        :type => :string,\n        :multi => true\n    opt :keys,\n        \"Override search path(s) for CMDB key files\",\n        :type => :strings\n    opt :pretend,\n        \"Check for errors, but do not actually launch the app or rewrite files\",\n        :default => false\n    opt :quiet,\n        \"Don't print any output\",\n        :default => false\n    opt :reload,\n        \"CMDB key that enables reload-on-edit\",\n        :type => :string\n    opt :reload_signal,\n        \"Signal to send to app server when code is edited\",\n        :type => :string,\n        :default => \"HUP\"\n    opt :env,\n        \"Add CMDB keys to the app server's process environment\",\n        :default => false\n    opt :user,\n        \"Switch to named user before executing app\",\n        :type => :string\n    opt :root,\n        \"Promote named subkey to the root when it is present in a namespace\",\n        :type => :string\n  end\n\n  self.new(ARGV, options)\nend\n"