]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
minor improvements to wording of inline command help
authorelijah <elijah@riseup.net>
Sun, 24 Feb 2013 04:52:38 +0000 (20:52 -0800)
committerelijah <elijah@riseup.net>
Sun, 24 Feb 2013 04:52:38 +0000 (20:52 -0800)
12 files changed:
lib/leap_cli/commands/ca.rb
lib/leap_cli/commands/clean.rb
lib/leap_cli/commands/compile.rb
lib/leap_cli/commands/deploy.rb
lib/leap_cli/commands/inspect.rb
lib/leap_cli/commands/list.rb
lib/leap_cli/commands/new.rb
lib/leap_cli/commands/node.rb
lib/leap_cli/commands/shell.rb
lib/leap_cli/commands/test.rb
lib/leap_cli/commands/user.rb
lib/leap_cli/commands/vagrant.rb

index 7c6fc4d974861a247b51784711e4fcac03381c43..d3f864afbe0e998ff0aec56561651c1aaed51bd4 100644 (file)
@@ -9,6 +9,7 @@ module LeapCli; module Commands
   command :cert do |cert|
 
     cert.desc 'Creates two Certificate Authorities (one for validating servers and one for validating clients).'
+    cert.long_desc 'See see what values are used in the generation of the certificates (like name and key size), run `leap inspect provider` and look for the "ca" property. To see the details of the created certs, run `leap inspect <file>`.'
     cert.command :ca do |ca|
       ca.action do |global_options,options,args|
         assert_config! 'provider.ca.name'
@@ -17,7 +18,7 @@ module LeapCli; module Commands
       end
     end
 
-    cert.desc 'Creates or renews a X.509 certificate/key pair for a single node or all nodes, but only if needed'
+    cert.desc 'Creates or renews a X.509 certificate/key pair for a single node or all nodes, but only if needed.'
     cert.long_desc 'This command will a generate new certificate for a node if some value in the node has changed ' +
                    'that is included in the certificate (like hostname or IP address), or if the old certificate will be expiring soon. ' +
                    'Sometimes, you might want to force the generation of a new certificate, ' +
@@ -45,7 +46,7 @@ module LeapCli; module Commands
       end
     end
 
-    cert.desc 'Creates a Diffie-Hellman parameter file' # (needed for server-side of some TLS connections)
+    cert.desc 'Creates a Diffie-Hellman parameter file.' # (needed for server-side of some TLS connections)
     cert.command :dh do |dh|
       dh.action do |global_options,options,args|
         long_running do
@@ -79,7 +80,8 @@ module LeapCli; module Commands
     # nice details about CSRs:
     #   http://www.redkestrel.co.uk/Articles/CSR.html
     #
-    cert.desc 'Creates a CSR for use in buying a commercial X.509 certificate'
+    cert.desc "Creates a CSR for use in buying a commercial X.509 certificate."
+    cert.long_desc "The CSR created is for the for the provider's primary domain. The properties used for this CSR come from `provider.ca.server_certificates`."
     cert.command :csr do |csr|
       #c.switch 'sign', :desc => 'additionally creates a cert that is signed by your own CA (recommended only for testing)', :negatable => false
       csr.action do |global_options,options,args|
index 8847b7d94a315323dbb0061bb020d16b360034fa..a9afff53b256ed7247b68313d50c0ee3dfa2b522 100644 (file)
@@ -1,7 +1,7 @@
 module LeapCli
   module Commands
 
-    desc 'Removes all files generated with the "compile" command'
+    desc 'Removes all files generated with the "compile" command.'
     command :clean do |c|
       c.action do |global_options,options,args|
         Dir.glob(path([:hiera, '*'])).each do |file|
index 0e645d6c6160ae0514be099405306215b546f184..3cdd5dd8b6469e7ca45ce1df5360deb4e231ae40 100644 (file)
@@ -2,7 +2,7 @@
 module LeapCli
   module Commands
 
-    desc 'Compiles node configuration files into hiera files used for deployment'
+    desc 'Compiles node configuration files into hiera files used for deployment.'
     command :compile do |c|
       c.action do |global_options,options,args|
         compile_hiera_files
index 115f06c6d30598e00867b2369ad00d89345b504c..024e8d0e7db1bf24ea979c30bda9a318aae24952 100644 (file)
@@ -4,9 +4,9 @@ module LeapCli
 
     DEFAULT_TAGS = ['leap_base','leap_service']
 
-    desc 'Apply recipes to a node or set of nodes'
-    long_desc 'The node-filter can be the name of a node, service, or tag.'
-    arg_name 'node-filter'
+    desc 'Apply recipes to a node or set of nodes.'
+    long_desc 'The FILTER can be the name of a node, service, or tag.'
+    arg_name 'FILTER'
     command :deploy do |c|
 
       # --fast
index 97d0b2086322494beeb9940c5e1d7b542975fe26..0c4035651f049418f22d3993153b4f3157708d29 100644 (file)
@@ -1,11 +1,11 @@
 module LeapCli; module Commands
 
-  desc 'Prints information about a file or node.'
-  arg_name '<file-or-node>', :optional => false
+  desc 'Prints details about a file. Alternately, the argument FILE can be the name of a node, service or tag.'
+  arg_name 'FILE'
   command :inspect do |c|
     c.action do |global_options,options,args|
       object = args.first
-      assert! object, 'A file path or node name is required'
+      assert! object, 'A file path or node/service/tag name is required'
       method = inspection_method(object)
       if method && defined?(method)
         self.send(method, object, options)
index 02389e7dc15c252601fcde10a0da40f5a24a6d36..4ff23678345d5e8069a042024d0f6c047e84c801 100644 (file)
@@ -4,13 +4,13 @@ module LeapCli; module Commands
 
   desc 'List nodes and their classifications'
   long_desc 'Prints out a listing of nodes, services, or tags. ' +
-            'The node-filter can be a list of names of nodes, services, or tags. ' +
+            'If present, the FILTER can be a list of names of nodes, services, or tags. ' +
             'If the name is prefixed with +, this acts like an AND condition. ' +
             "For example:\n\n" +
-            " * node1 node2    -> matches all nodes named \"node1\" OR \"node2\"\n\n" +
-            " * openvpn +local -> matches all nodes with service \"openvpn\" AND tag \"local\""
+            "`leap list node1 node2` matches all nodes named \"node1\" OR \"node2\"\n\n" +
+            "`leap list openvpn +local` matches all nodes with service \"openvpn\" AND tag \"local\""
 
-  arg_name '[node-filter]', :optional => true
+  arg_name 'FILTER', :optional => true
   command :list do |c|
     c.flag 'print', :desc => 'What attributes to print (optional)'
     c.action do |global_options,options,args|
index b6eb4f1363908db583f642bdff16116815f00946..bf8e7f179a7fe4aa32d07f8d068d9f38b36bc32d 100644 (file)
@@ -6,10 +6,10 @@ module LeapCli; module Commands
   arg_name 'DIRECTORY'
   skips_pre
   command :new do |c|
-    c.flag 'name', :desc => "The name of the provider" #, :default_value => 'Example'
-    c.flag 'domain', :desc => "The primary domain of the provider" #, :default_value => 'example.org'
-    c.flag 'platform', :desc => "File path of the leap_platform directory" #, :default_value => '../leap_platform'
-    c.flag 'contacts', :desc => "Default email address contacts" #, :default_value => 'root'
+    c.flag 'name', :desc => "The name of the provider." #, :default_value => 'Example'
+    c.flag 'domain', :desc => "The primary domain of the provider." #, :default_value => 'example.org'
+    c.flag 'platform', :desc => "File path of the leap_platform directory." #, :default_value => '../leap_platform'
+    c.flag 'contacts', :desc => "Default email address contacts." #, :default_value => 'root'
 
     c.action do |global, options, args|
       directory = File.expand_path(args.first)
index bb02fa974f6fe62d10242c03c37c9392b6d441f1..e8f2c7388e0f9938c40ee9675d0c3473672ea1d2 100644 (file)
@@ -10,13 +10,13 @@ module LeapCli; module Commands
 
   desc 'Node management'
   command :node do |node|
-    node.desc 'Create a new configuration file for a node'
-    node.long_desc ["If specified, the optional argument seed-options can be used to seed values in the node configuration file.",
+    node.desc 'Create a new configuration file for a node named NAME.'
+    node.long_desc ["If specified, the optional argument SEED can be used to seed values in the node configuration file.",
                     "The format is property_name:value.",
                     "For example: `leap node add web1 ip_address:1.2.3.4 services:webapp`.",
                     "To set nested properties, property name can contain '.', like so: `leap node add web1 ssh.port:44`",
-                    "To set multiple values for a single property, use ',', like so: `leap node add mynode services:webapp,dns`"].join("\n\n")
-    node.arg_name '<node-name> [seed-options]' # , :optional => false, :multiple => false
+                    "Separeate multiple values for a single property with a comma, like so: `leap node add mynode services:webapp,dns`"].join("\n\n")
+    node.arg_name 'NAME [SEED]' # , :optional => false, :multiple => false
     node.command :add do |add|
       add.switch :local, :desc => 'Make a local testing node (by automatically assigning the next available local IP address). Local nodes are run as virtual machines on your computer.', :negatable => false
       add.action do |global_options,options,args|
@@ -48,7 +48,7 @@ module LeapCli; module Commands
                    "copying the authorized_keys file, and installing packages that are required for deploying. " +
                    "Node init must be run before deploying to a server, and the server must be running and available via the network. " +
                    "This command only needs to be run once, but there is no harm in running it multiple times."
-    node.arg_name '<node-filter>' #, :optional => false, :multiple => false
+    node.arg_name 'FILTER' #, :optional => false, :multiple => false
     node.command :init do |init|
       init.switch 'echo', :desc => 'If set, passwords are visible as you type them (default is hidden)', :negatable => false
       init.action do |global,options,args|
@@ -68,8 +68,8 @@ module LeapCli; module Commands
       end
     end
 
-    node.desc 'Renames a node file, and all its related files'
-    node.arg_name '<old-name> <new-name>'
+    node.desc 'Renames a node file, and all its related files.'
+    node.arg_name 'OLD_NAME NEW_NAME'
     node.command :mv do |mv|
       mv.action do |global_options,options,args|
         node = get_node_from_args(args)
@@ -82,8 +82,8 @@ module LeapCli; module Commands
       end
     end
 
-    node.desc 'Removes a node file, and all its related files'
-    node.arg_name '<node-name>' #:optional => false #, :multiple => false
+    node.desc 'Removes all the files related to the node named NAME.'
+    node.arg_name 'NAME' #:optional => false #, :multiple => false
     node.command :rm do |rm|
       rm.action do |global_options,options,args|
         node = get_node_from_args(args)
index 5d8fc662a9cfb636c23aed69a2bf84d599d464a4..cc17408145a6026fdbf9e8f2db0453b288997f32 100644 (file)
@@ -1,7 +1,7 @@
 module LeapCli; module Commands
 
-  desc 'Log in to the specified node with an interactive shell'
-  arg_name '<node-name>', :optional => false, :multiple => false
+  desc 'Log in to the specified node with an interactive shell.'
+  arg_name 'NAME' #, :optional => false, :multiple => false
   command :ssh do |c|
     c.action do |global_options,options,args|
       node = get_node_from_args(args)
index e895a5ec021391aceac0299a0b9a065709bb3c9d..80a6333886b5d7e2807270cc3ba1f0ace4401fd4 100644 (file)
@@ -1,23 +1,23 @@
 module LeapCli; module Commands
 
-  desc 'Run tests'
-  command :test do |c|
-    c.desc 'Creates files needed to run tests'
-    c.command :init do |c|
-      c.action do |global_options,options,args|
+  desc 'Run tests.'
+  command :test do |test|
+    test.desc 'Creates files needed to run tests.'
+    test.command :init do |init|
+      init.action do |global_options,options,args|
         generate_test_client_cert
         generate_test_client_openvpn_config
       end
     end
 
-    c.desc 'Run tests'
-    c.command :run do |c|
-      c.action do |global_options,options,args|
+    test.desc 'Run tests.'
+    test.command :run do |run|
+      run.action do |global_options,options,args|
         log 'not yet implemented'
       end
     end
 
-    c.default_command :run
+    test.default_command :run
   end
 
   private
index aed29b7112beb8f1d9a17e8a4fb40194ff0e1223..d0146b6f705d0815515196f4842796a7a1c260e7 100644 (file)
@@ -15,7 +15,7 @@ module LeapCli
   module Commands
 
     desc 'Adds a new trusted sysadmin'
-    arg_name '<username>', :optional => false, :multiple => false
+    arg_name 'USERNAME' #, :optional => false, :multiple => false
     command :'add-user' do |c|
 
       c.switch 'self', :desc => 'lets you choose among your public keys', :negatable => false
index 5aeed74ecd62d9c4079697c107daaa8d8a2cc62d..56e887aed69bba3c222bc11b6ff7d1b220706aa8 100644 (file)
@@ -3,11 +3,11 @@ require 'fileutils'
 
 module LeapCli; module Commands
 
-  desc "Manage local virtual machines"
-  long_desc "This command provides a convient way to manage Vagrant-based virtual machines. If node-filter argument is missing, the command runs on all local virtual machines. The Vagrantfile is automatically generated in 'test/Vagrantfile'. If you want to run vagrant commands manually, cd to 'test'."
+  desc "Manage local virtual machines."
+  long_desc "This command provides a convient way to manage Vagrant-based virtual machines. If FILTER argument is missing, the command runs on all local virtual machines. The Vagrantfile is automatically generated in 'test/Vagrantfile'. If you want to run vagrant commands manually, cd to 'test'."
   command :local do |local|
     local.desc 'Starts up the virtual machine(s)'
-    local.arg_name 'node-filter', :optional => true #, :multiple => false
+    local.arg_name 'FILTER', :optional => true #, :multiple => false
     local.command :start do |start|
       start.action do |global_options,options,args|
         vagrant_command(["up", "sandbox on"], args)
@@ -15,7 +15,7 @@ module LeapCli; module Commands
     end
 
     local.desc 'Shuts down the virtual machine(s)'
-    local.arg_name 'node-filter', :optional => true #, :multiple => false
+    local.arg_name 'FILTER', :optional => true #, :multiple => false
     local.command :stop do |stop|
       stop.action do |global_options,options,args|
         if global_options[:yes]
@@ -27,7 +27,7 @@ module LeapCli; module Commands
     end
 
     local.desc 'Destroys the virtual machine(s), reclaiming the disk space'
-    local.arg_name 'node-filter', :optional => true #, :multiple => false
+    local.arg_name 'FILTER', :optional => true #, :multiple => false
     local.command :destroy do |destroy|
       destroy.action do |global_options,options,args|
         if global_options[:yes]
@@ -39,7 +39,7 @@ module LeapCli; module Commands
     end
 
     local.desc 'Print the status of local virtual machine(s)'
-    local.arg_name 'node-filter', :optional => true #, :multiple => false
+    local.arg_name 'FILTER', :optional => true #, :multiple => false
     local.command :status do |status|
       status.action do |global_options,options,args|
         vagrant_command("status", args)
@@ -47,7 +47,7 @@ module LeapCli; module Commands
     end
 
     local.desc 'Saves the current state of the virtual machine as a new snapshot'
-    local.arg_name 'node-filter', :optional => true #, :multiple => false
+    local.arg_name 'FILTER', :optional => true #, :multiple => false
     local.command :save do |status|
       status.action do |global_options,options,args|
         vagrant_command("sandbox commit", args)
@@ -55,7 +55,7 @@ module LeapCli; module Commands
     end
 
     local.desc 'Resets virtual machine(s) to the last saved snapshot'
-    local.arg_name 'node-filter', :optional => true #, :multiple => false
+    local.arg_name 'FILTER', :optional => true #, :multiple => false
     local.command :reset do |reset|
       reset.action do |global_options,options,args|
         vagrant_command("sandbox rollback", args)