Salome HOME
Improve help of each command
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Thu, 6 Oct 2016 10:07:35 +0000 (12:07 +0200)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Thu, 6 Oct 2016 10:07:35 +0000 (12:07 +0200)
25 files changed:
commands/application.py
commands/base.py
commands/check.py
commands/clean.py
commands/compile.py
commands/config.py
commands/configure.py
commands/environ.py
commands/find_duplicates.py
commands/generate.py
commands/job.py
commands/jobs.py
commands/launcher.py
commands/log.py
commands/make.py
commands/makeinstall.py
commands/package.py
commands/patch.py
commands/prepare.py
commands/run.py
commands/shell.py
commands/source.py
commands/template.py
commands/test.py
test/test/test_command.py

index 222ff5566935a8eb9486df1cc41951a645ca7ad0..78c8e39516d129014b1b78d2a5b91027debef407 100644 (file)
@@ -28,16 +28,20 @@ import src
 
 parser = src.options.Options()
 parser.add_option('n', 'name', 'string', 'name',
-    _('The name of the application (default is APPLI.name or runAppli)'))
+    _('Optional: The name of the application (default is APPLI.name or '
+      'runAppli)'))
 parser.add_option('c', 'catalog', 'string', 'catalog',
-    _('The resources catalog to use'))
+    _('Optional: The resources catalog to use'))
 parser.add_option('t', 'target', 'string', 'target',
-    _('The directory where to create the application (default is PRODUCT.out_dir)'))
+    _('Optional: The directory where to create the application (default is '
+      'APPLICATION.workdir)'))
 parser.add_option('', 'gencat', 'string', 'gencat',
-    _("""Create a resources catalog for the specified machines (separated with ',')
-\tNOTICE: this command will ssh to retrieve information to each machine in the list"""))
+    _("Optional: Create a resources catalog for the specified machines "
+      "(separated with ',')\n\tNOTICE: this command will ssh to retrieve "
+      "information to each machine in the list"))
 parser.add_option('m', 'module', 'list2', 'modules',
-    _("module(s) to include in the application"))
+    _("Optional: the restricted list of module(s) to include in the "
+      "application"))
 
 ##
 # Creates an alias for runAppli.
@@ -398,9 +402,10 @@ def description():
     :return: The text to display for the application command description.
     :rtype: str
     '''
-    return _("""The application command creates a SALOME application.\n"""
-             """WARNING: it works only for SALOME 6. Use the "launcher" """
-             """command for newer versions of SALOME""")
+    return _("The application command creates a SALOME application.\n"
+             "WARNING: it works only for SALOME 6. Use the \"launcher\" "
+             "command for newer versions of SALOME\n\nexample:\nsat application"
+             " SALOME-6.6.0")
 
 ##
 # Runs the command.
index cb407113248268d2cd2ec7a89ac3a55ec511ae0e..6df87b8a055b645dfe439fbe3f10881adf79a5b0 100644 (file)
@@ -23,7 +23,7 @@ import src
 # Define all possible option for the shell command :  sat base <options>
 parser = src.options.Options()
 parser.add_option('s', 'set', 'string', 'base_path',
-    _('The path directory to use as base.'), None)
+    _('Optional: The path directory to use as base.'), None)
 
 def set_base(config, path, site_file_path, logger):
     """ Edit the site.pyconf file and change the base path
@@ -70,7 +70,7 @@ def description():
     :rtype: str
     '''
     return _("Display or set the base where to put installations of base "
-             "products")
+             "products\n\nexample\nsat base --set /tmp/BASE")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with base parameter.
index b9e1528b21cbf4f9cdb4b668f88adc8d8783ffc9..5b09e594136cc9347e27d5bb9bc6dea7372cf61f 100644 (file)
@@ -23,7 +23,7 @@ import src
 # Define all possible option for the check command :  sat check <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products to configure. This option can be'
+    _('Optional: products to configure. This option can be'
     ' passed several time to configure several products.'))
 
 def get_products_list(options, cfg, logger):
@@ -163,7 +163,10 @@ def description():
     :rtype: str
     '''
     return _("The check command executes the \"check\" command in"
-             " the build directory")
+             " the build directory of all the products of the application."
+             "\nIt is possible to reduce the list of products to check by using"
+             " the --products option\n\nexample\nsat check SALOME-master "
+             "--products KERNEL,GUI,GEOM")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with check parameter.
index 83459b73c038d9d145087e93417907be9b74a19f..07239bc4a8a384f9dec1944e6ab61395ddf45f1a 100644 (file)
@@ -32,21 +32,21 @@ PROPERTY_EXPRESSION = "^.+:.+$"
 # Define all possible option for the clean command :  sat clean <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('Products to clean. This option can be'
+    _('Optional: Products to clean. This option can be'
     ' passed several time to clean several products.'))
 parser.add_option('', 'properties', 'string', 'properties',
-    _('Filter the products by their properties.\n\tSyntax: '
+    _('Optional: Filter the products by their properties.\n\tSyntax: '
       '--properties <property>:<value>'))
 parser.add_option('s', 'sources', 'boolean', 'sources', 
-    _("Clean the product source directories."))
+    _("Optional: Clean the product source directories."))
 parser.add_option('b', 'build', 'boolean', 'build', 
-    _("Clean the product build directories."))
+    _("Optional: Clean the product build directories."))
 parser.add_option('i', 'install', 'boolean', 'install', 
-    _("Clean the product install directories."))
+    _("Optional: Clean the product install directories."))
 parser.add_option('a', 'all', 'boolean', 'all', 
-    _("Clean the product source, build and install directories."))
+    _("Optional: Clean the product source, build and install directories."))
 parser.add_option('', 'sources_without_dev', 'boolean', 'sources_without_dev', 
-    _("do not clean the products in development mode."))
+    _("Optional: do not clean the products in development mode."))
 
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
@@ -177,7 +177,10 @@ def description():
     :rtype: str
     '''
     return _("The clean command suppress the source, build, or install "
-             "directories of the application products.")
+             "directories of the application products.\nUse the options to"
+             " define what directories you want to suppress and to reduce "
+             "the list of products\n\nexample:\nsat clean SALOME-master "
+             "--build --install --properties is_salome_module:yes")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with clean parameter.
index d2d157711b9d662ef552bbd5af48140043510c02..9a2d0956c73ebc5dc34f9ca2d9ab79c18c4a7936 100644 (file)
@@ -30,24 +30,27 @@ except NameError:
 # Define all possible option for the compile command :  sat compile <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products to configure. This option can be'
+    _('Optional: products to configure. This option can be'
     ' passed several time to configure several products.'))
 parser.add_option('', 'with_fathers', 'boolean', 'fathers',
-    _("build all necessary products to the given product (KERNEL is build before"
-      " building GUI)."), False)
+    _("Optional: build all necessary products to the given product (KERNEL is "
+      "build before building GUI)."), False)
 parser.add_option('', 'with_children', 'boolean', 'children',
-    _("build all products using the given product (all SMESH plugins are build "
-      "after SMESH)."), False)
+    _("Optional: build all products using the given product (all SMESH plugins"
+      " are build after SMESH)."), False)
 parser.add_option('', 'clean_all', 'boolean', 'clean_all',
-    _("clean BUILD dir and INSTALL dir before building product."), False)
+    _("Optional: clean BUILD dir and INSTALL dir before building product."),
+    False)
 parser.add_option('', 'clean_install', 'boolean', 'clean_install',
-    _("clean INSTALL dir before building product."), False)
+    _("Optional: clean INSTALL dir before building product."), False)
 parser.add_option('', 'make_flags', 'string', 'makeflags',
-    _("add extra options to the 'make' command."))
+    _("Optional: add extra options to the 'make' command."))
 parser.add_option('', 'show', 'boolean', 'no_compile',
-    _("DO NOT COMPILE just show if products are installed or not."), False)
-parser.add_option('', 'stop_first_fail', 'boolean', 'stop_first_fail', _("Stop"
-                    "s the command at first product compilation fail."), False)
+    _("Optional: DO NOT COMPILE just show if products are installed or not."),
+    False)
+parser.add_option('', 'stop_first_fail', 'boolean', 'stop_first_fail', _(
+                  "Optional: Stops the command at first product compilation"
+                  " fail."), False)
 
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
@@ -504,7 +507,9 @@ def description():
     :return: The text to display for the compile command description.
     :rtype: str
     '''
-    return _("The compile command constructs the products of the application")
+    return _("The compile command constructs the products of the application"
+             "\n\nexample:\nsat compile SALOME-master --products KERNEL,GUI,"
+             "MEDCOUPLING --clean_all")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with compile parameter.
index a330d4630e32a7e6df0fcdd990d832d1d7a21d9a..07e28b66d9151c7495caa51a52b227c8bc2f81ae 100644 (file)
@@ -32,19 +32,19 @@ gettext.install('salomeTools', os.path.join(satdir, 'src', 'i18n'))
 # Define all possible option for config command :  sat config <options>
 parser = src.options.Options()
 parser.add_option('v', 'value', 'string', 'value',
-    _("print the value of CONFIG_VARIABLE."))
+    _("Optional: print the value of CONFIG_VARIABLE."))
 parser.add_option('e', 'edit', 'boolean', 'edit',
-    _("edit the product configuration file."))
+    _("Optional: edit the product configuration file."))
 parser.add_option('i', 'info', 'string', 'info',
-    _("get information on a product."))
+    _("Optional: get information on a product."))
 parser.add_option('l', 'list', 'boolean', 'list',
-    _("list all available applications."))
+    _("Optional: list all available applications."))
 parser.add_option('c', 'copy', 'boolean', 'copy',
-    _("""copy a config file to the personal config files directory.
+    _("""Optional: copy a config file to the personal config files directory.
 \tWARNING the included files are not copied.
 \tIf a name is given the new config file takes the given name."""))
 parser.add_option('n', 'no_label', 'boolean', 'no_label',
-    _("do not print labels, Works only with --value and --list."))
+    _("Internal use: do not print labels, Works only with --value and --list."))
 parser.add_option('s', 'schema', 'boolean', 'schema',
     _("Internal use."))
 
@@ -763,7 +763,8 @@ def description():
     :rtype: str
     '''
     return _("The config command allows manipulation "
-             "and operation on config files.")
+             "and operation on config files.\n\nexample:\nsat config "
+             "SALOME-master --info ParaView")
     
 
 def run(args, runner, logger):
index 2fe672c9662bfddf46e5cc82a38e4fc91ba72399..2fa43e715ffe59d1e27b428ea8864f4a43be9dae 100644 (file)
@@ -23,10 +23,10 @@ import src
 # Define all possible option for configure command :  sat configure <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products to configure. This option can be'
+    _('Optional: products to configure. This option can be'
     ' passed several time to configure several products.'))
 parser.add_option('o', 'option', 'string', 'option',
-    _('Option to add to the configure or cmake command.'), "")
+    _('Optional: Option to add to the configure or cmake command.'), "")
 
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
@@ -177,11 +177,12 @@ def description():
     :rtype: str
     '''
     return _("The configure command executes in the build directory"
-             " the configure commands corresponding to the compilation mode"
+             " the configure commands corresponding\nto the compilation mode"
              " of the application products.\nThe possible compilation modes"
              " are \"cmake\", \"autotools\", or a script.\n\nHere are the "
              "commands to be run :\nautotools: build_configure and configure\n"
-             "cmake: cmake\nscript: N\A")
+             "cmake: cmake\nscript: do nothing\n\nexample:\nsat configure "
+             "SALOME-master --products KERNEL,GUI,PARAVIS")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with make parameter.
index 777efa6c6d43c605e5d9b245819491171ee17a94..a552fddf0aa609d77e637f08ee8dc23fa23a4e49 100644 (file)
@@ -22,14 +22,15 @@ import src
 
 parser = src.options.Options()
 parser.add_option('', 'shell', 'list2', 'shell',
-    _("Generates the environment files for the given format: "
+    _("Optional: Generates the environment files for the given format: "
       "bash (default), bat (for windows) or all."), [])
 parser.add_option('p', 'products', 'list2', 'products',
-    _("Includes only the specified products."))
+    _("Optional: Includes only the specified products."))
 parser.add_option('', 'prefix', 'string', 'prefix',
-    _("Specifies the prefix for the environment files."), "env")
+    _("Optional: Specifies the prefix for the environment files."), "env")
 parser.add_option('t', 'target', 'string', 'out_dir',
-    _("Specifies the directory path where to put the environment files."),
+    _("Optional: Specifies the directory path where to put the environment "
+      "files."),
     None)
 
 # list of available shells with extensions
@@ -115,8 +116,8 @@ def write_all_source_files(config,
 ##
 # Describes the command
 def description():
-    return _("The environ command generates the "
-                "environment files of your application.")
+    return _("The environ command generates the environment files of your "
+             "application.\n\nexample:\nsat environ SALOME-master")
 
 ##
 # Runs the command.
index 3f346a441818e54be30c07f57b0e67327ed15f1f..4a6c5e5b82fa480c66f6357afd4518585eaef9b6 100644 (file)
@@ -31,22 +31,24 @@ parser.add_option("p",
                   "path",
                   "string",
                   "path",
-                  _("Search the duplicate files in the given directory path."))
+                  _("Optional: Search the duplicate files in the given "
+                    "directory path."))
 parser.add_option("",
                   "exclude-file",
                   "list2",
                   "exclude_file",
-                  _("Override the default list of filtered files."))
+                  _("Optional: Override the default list of filtered files."))
 parser.add_option("",
                   "exclude-extension",
                   "list2",
                   "exclude_extension",
-                  _("Override the default list of filtered extensions."))
+                  _("Optional: Override the default list of filtered "
+                    "extensions."))
 parser.add_option("",
                   "exclude-path",
                   "list2",
                   "exclude_path",
-                  _("Override the default list of filtered pathes."))
+                  _("Optional: Override the default list of filtered paths."))
 
 default_extension_ignored = ['html', 'png', 'txt', 'js', 'xml', 'cmake', 'gif', 
                      'm4', 'in', 'pyo', 'pyc', 'doctree', 'css']
@@ -154,7 +156,8 @@ def description():
     '''
     return _("The find_duplicates command search recursively for all duplicates"
              " files in a the INSTALL directory (or the optionally given "
-             "directory) and prints the found files to the terminal.")
+             "directory) and prints the found files to the terminal.\n\n"
+             "example:\nsat find_duplicates --path /tmp")
 
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with find_duplicates 
index b7d53f8a083572e1a04fa71b95fea15dc47dc210..c60a22b1e825b4c9089a56d82f3499d5f97a56f7 100644 (file)
@@ -26,9 +26,9 @@ import src
 
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-                  _("the list of products to generate"))
+                  _("Optional: the list of products to generate"))
 parser.add_option('', 'yacsgen', 'string', 'yacsgen',
-                  _("path to YACSGEN's module_generator package"))
+                  _("Optional: path to YACSGEN's module_generator package"))
 
 def generate_component_list(config, product_info, context, logger):
     res = "?"
@@ -301,7 +301,8 @@ def description():
     :rtype: str
     '''
     return _("The generate command generates SALOME modules from 'pure cpp' "
-             "products.\nWARNING this command NEEDS YACSGEN to run!")
+             "products.\nWARNING this command NEEDS YACSGEN to run!\n\nexample:"
+             "\nsat generate SALOME-master --products FLICACPP")
 
 
 def run(args, runner, logger):
index e78a298bbd145e67cf9bd5de0c9b92d31852bb41..0b7ed6db0bd741c9455a2dc90cccdf299e0a2143 100644 (file)
@@ -23,10 +23,10 @@ import src
 # Define all possible option for the make command :  sat make <options>
 parser = src.options.Options()
 parser.add_option('j', 'jobs_config', 'string', 'jobs_cfg', 
-                  _('The name of the config file that contains'
+                  _('Mandatory: The name of the config file that contains'
                   ' the jobs configuration'))
 parser.add_option('', 'name', 'string', 'job',
-    _('The job name from which to execute commands.'), "")
+    _('Mandatory: The job name from which to execute commands.'), "")
 
 def description():
     '''method that is called when salomeTools is called with --help option.
@@ -35,7 +35,8 @@ def description():
     :rtype: str
     '''
     return _("Executes the commands of the job defined"
-             " in the jobs configuration file")
+             " in the jobs configuration file\n\nexample:\nsat job "
+             "--jobs_config my_jobs --name my_job")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with job parameter.
@@ -52,6 +53,12 @@ def run(args, runner, logger):
         logger.write(src.printcolors.printcError(message))
         return 1
     
+    # Make sure the name option has been called
+    if not options.job:
+        message = _("The option --name is required\n")      
+        logger.write(src.printcolors.printcError(message))
+        return 1
+    
     # Find the file in the directories
     found = False
     for cfg_dir in l_cfg_dir:
index 66392da96c7d89f4dc46961338ec96df933758a9..9ac0b123cba22327787d14ab5e6ed89c8de129dd 100644 (file)
@@ -37,7 +37,7 @@ CSV_DELIMITER = ";"
 parser = src.options.Options()
 
 parser.add_option('n', 'name', 'string', 'jobs_cfg', 
-                  _('The name of the config file that contains'
+                  _('Mandatory: The name of the config file that contains'
                   ' the jobs configuration'))
 parser.add_option('o', 'only_jobs', 'list2', 'only_jobs',
                   _('Optional: the list of jobs to launch, by their name. '))
@@ -54,7 +54,7 @@ parser.add_option('p', 'publish', 'boolean', 'publish',
 parser.add_option('i', 'input_boards', 'string', 'input_boards', _("Optional: "
                                 "the path to csv file that contain "
                                 "the expected boards."),"")
-parser.add_option('n', 'completion', 'boolean', 'no_label',
+parser.add_option('', 'completion', 'boolean', 'no_label',
                   _("Optional (internal use): do not print labels, Works only "
                     "with --list."),
                   False)
@@ -1484,7 +1484,8 @@ class Gui(object):
 # Describes the command
 def description():
     return _("The jobs command launches maintenances that are described"
-             " in the dedicated jobs configuration file.")
+             " in the dedicated jobs configuration file.\n\nexample:\nsat "
+             "jobs --name my_jobs --publish")
 
 ##
 # Runs the command.
index 537aecbabaf0df364eca0df3de68ed307272893c..3367535aa604b85f01d8997276477dfdb9cba4ed 100644 (file)
@@ -27,12 +27,13 @@ import src
 \r
 parser = src.options.Options()\r
 \r
-parser.add_option('n', 'name', 'string', 'name', _('The name of the launcher '\r
-                            '(default is APPLICATION.profile.launcher_name)'))\r
+parser.add_option('n', 'name', 'string', 'name', _('Optional: The name of the'\r
+                            ' launcher (default is '\r
+                            'APPLICATION.profile.launcher_name)'))\r
 parser.add_option('c', 'catalog', 'string', 'catalog',\r
-    _('The resources catalog to use'))\r
+    _('Optional: The resources catalog to use'))\r
 parser.add_option('', 'gencat', 'string', 'gencat',\r
-    _("Create a resources catalog for the specified machines "\r
+    _("Optional: Create a resources catalog for the specified machines "\r
       "(separated with ',') \n\tNOTICE: this command will ssh to retrieve"\r
       " information to each machine in the list"))\r
 \r
@@ -349,7 +350,8 @@ def finish_profile_install(config, launcherPath):
 ##\r
 # Describes the command\r
 def description():\r
-    return _("The launcher command generates a salome launcher.")\r
+    return _("The launcher command generates a SALOME launcher.\n\nexample:"\r
+             "\nsat launcher SALOME-master")\r
 \r
 ##\r
 # Runs the command.\r
index 504108d5dfdae24e631bc096e6e8630ba1b10b8b..83be78949e57ac4d2813532228e65ac4180c62f6 100644 (file)
@@ -32,13 +32,14 @@ import src
 
 # Define all possible option for log command :  sat log <options>
 parser = src.options.Options()
-parser.add_option('t', 'terminal', 'boolean', 'terminal', "Terminal log.")
+parser.add_option('t', 'terminal', 'boolean', 'terminal', "Optional: "
+                  "Terminal log.")
 parser.add_option('l', 'last', 'boolean', 'last', "Show the log of the last "
-                  "launched command.")
-parser.add_option('f', 'full', 'boolean', 'full', "Show the logs of ALL "
-                  "launched commands.")
-parser.add_option('c', 'clean', 'int', 'clean', "Erase the n most ancient "
-                  "log files.")
+                  "Optional: launched command.")
+parser.add_option('f', 'full', 'boolean', 'full', "Optional: Show the logs of "
+                  "ALL the launched commands.")
+parser.add_option('c', 'clean', 'int', 'clean', "Optional: Erase the n most "
+                  "ancient log files.")
 
 def get_last_log_file(logDir, notShownCommands):
     '''Used in case of last option. Get the last log command file path.
@@ -130,7 +131,8 @@ def description():
     :return: The text to display for the log command description.
     :rtype: str
     '''
-    return _("Gives access to the logs produced by the salomeTools commands.")    
+    return _("Gives access to the logs produced by the salomeTools commands.\n"
+             "\nexample:\nsat log")    
 
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with log parameter.
index a3b77cae3df16720c5703a5d029c6eb0b68934cf..6cd7bac762b4efe924898d5af37e7b63da799a63 100644 (file)
@@ -24,10 +24,10 @@ import src
 # Define all possible option for the make command :  sat make <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products to configure. This option can be'
+    _('Optional: products to configure. This option can be'
     ' passed several time to configure several products.'))
 parser.add_option('o', 'option', 'string', 'option',
-    _('Option to add to the make command.'), "")
+    _('Optional: Option to add to the make command.'), "")
 
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
@@ -208,7 +208,10 @@ def description():
     :rtype: str
     '''
     return _("The make command executes the \"make\" command in"
-             " the build directory")
+             " the build directory.\nIn case of a product that is constructed "
+             "using a script (build_source :  \"script\"), then the make "
+             "command executes the script.\n\nexample:\nsat make SALOME-master "
+             "--products Python,KERNEL,GUI")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with make parameter.
index 22409ab8dfe90235a8124adf9d82acdca12b0f33..2e8e8fd7b26b0a3e5653e9e3c6cbe3b5fb6619c6 100644 (file)
@@ -23,8 +23,8 @@ import src
 # Define all possible option for the makeinstall command : sat makeinstall <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products to configure. This option can be'
-    ' passed several time to configure several products.'))
+    _('Optional: products to install. This option can be'
+    ' passed several time to install several products.'))
 
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
@@ -164,7 +164,10 @@ def description():
     :rtype: str
     '''
     return _("The makeinstall command executes the \"make install\" command in"
-             " the build directory")
+             " the build directory.\nIn case of  product that is constructed "
+             "using a script (build_source :  \"script\"), then the "
+             "makeinstall command do nothing.\n\nexample:\nsat makeinstall "
+             "SALOME-master --products KERNEL,GUI")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with makeinstall parameter.
index a3b60830ffeeca2d5e42b1d601c6ec4e2743e00e..2c670d4747e4136fc3d8b1ae758b31fe27985a5a 100644 (file)
@@ -79,23 +79,25 @@ project_file_paths : [$VARS.salometoolsway + $VARS.sep + \"..\" + $VARS.sep"""
 # Define all possible option for the package command :  sat package <options>
 parser = src.options.Options()
 parser.add_option('b', 'binaries', 'boolean', 'binaries',
-    _('Produce a binary package.'), False)
+    _('Optional: Produce a binary package.'), False)
 parser.add_option('f', 'force_creation', 'boolean', 'force_creation',
-    _('Only binary package: produce the archive even if there are some missing '
-      'products.'), False)
+    _('Optional: Only binary package: produce the archive even if '
+      'there are some missing products.'), False)
 parser.add_option('', 'with_sources', 'boolean', 'with_sources',
-    _('Only binary package: produce and and a source archive in the binary '
-      'package.'), False)
+    _('Optional: Only binary package: produce and and a source archive in the '
+      'binary package.'), False)
 parser.add_option('s', 'sources', 'boolean', 'sources',
-    _('Produce a compilable archive of the sources of the application.'), False)
+    _('Optional: Produce a compilable archive of the sources of the '
+      'application.'), False)
 parser.add_option('', 'with_vcs', 'boolean', 'with_vcs',
-    _('Only source package: do not make archive of vcs products.'), False)
+    _('Optional: Only source package: do not make archive of vcs products.'),
+    False)
 parser.add_option('p', 'project', 'string', 'project',
-    _('Produce an archive that contains a project.'), "")
+    _('Optional: Produce an archive that contains a project.'), "")
 parser.add_option('t', 'salometools', 'boolean', 'sat',
-    _('Produce an archive that contains salomeTools.'), False)
+    _('Optional: Produce an archive that contains salomeTools.'), False)
 parser.add_option('n', 'name', 'string', 'name',
-    _('The name or full path of the archive.'), None)
+    _('Optional: The name or full path of the archive.'), None)
 
 def add_files(tar, name_archive, d_content, logger):
     '''Create an archive containing all directories and files that are given in
@@ -736,7 +738,8 @@ def description():
              " It contains the products archives, a project corresponding to "
              "the application and salomeTools,\n  3- The project archive. It "
              "contains a project (give the project file path as argument),\n  4-"
-             " The salomeTools archive. It contains salomeTools.")
+             " The salomeTools archive. It contains salomeTools.\n\nexample:"
+             "\nsat package SALOME-master --sources")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with package parameter.
@@ -754,7 +757,8 @@ def run(args, runner, logger):
     # Check if no option for package type
     if all_option_types.count(True) == 0:
         msg = _("Error: Precise a type for the package\nUse one of the "
-                "following options: --binaries, --sources, --project or --sat")
+                "following options: --binaries, --sources, --project or"
+                " --salometools")
         logger.write(src.printcolors.printcError(msg), 1)
         logger.write("\n", 1)
         return 1
index 2d12bbbefc7b29a63f05dba3ee90fc1911c8f826..900753c684f715bb09233f2e3b2c95f11ac12518 100644 (file)
@@ -25,7 +25,7 @@ import prepare
 # Define all possible option for patch command :  sat patch <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products to get the sources. This option can be'
+    _('Optional: products to get the sources. This option can be'
     ' passed several time to get the sources of several products.'))
 
 def apply_patch(config, product_info, max_product_name_len, logger):
@@ -118,7 +118,8 @@ def description():
     :rtype: str
     '''
     return _("The patch command apply the patches on the sources of "
-             "the application products if there is any")
+             "the application products if there is any.\n\nexample:\nsat "
+             "patch SALOME-master --products qt,boost")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with patch parameter.
index eef6968f8b26c7b541946c49bb62b0a865b7005d..165efe6782ba07b123f6d5b3c769ddbc3eda3756 100644 (file)
@@ -23,12 +23,12 @@ import src
 # Define all possible option for prepare command :  sat prepare <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products to prepare. This option can be'
+    _('Optional: products to prepare. This option can be'
     ' passed several time to prepare several products.'))
 parser.add_option('f', 'force', 'boolean', 'force', 
-    _("force to prepare the products in development mode."))
+    _("Optional: force to prepare the products in development mode."))
 parser.add_option('', 'force_patch', 'boolean', 'force_patch', 
-    _("force to apply patch to the products in development mode."))
+    _("Optional: force to apply patch to the products in development mode."))
 
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
@@ -87,7 +87,8 @@ def description():
     :rtype: str
     '''
     return _("The prepare command gets the sources of "
-             "the application products and apply the patches if there is any.")
+             "the application products and apply the patches if there is any."
+             "\n\nexample:\nsat prepare SALOME-master --products KERNEL,GUI")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with prepare parameter.
index d5680bd4620489560af437cac4cf02ceb49e6251..fe3fd9b68a30caea18a18c0adbf33cceb75f2f56 100644 (file)
@@ -29,7 +29,7 @@ def description():
     :rtype: str
     '''
     return _("This command runs the application launcher"
-             " with the given arguments.")
+             " with the given arguments.\n\nexample:\nsat run SALOME-master")
 
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with run parameter.
index 4d722f067d513d34e68d8b64c3bfa38aa1ee689f..b246072512133ff5bbe80dd1e46e5282cf1baf79 100644 (file)
@@ -23,7 +23,7 @@ import src
 # Define all possible option for the shell command :  sat shell <options>
 parser = src.options.Options()
 parser.add_option('c', 'command', 'string', 'command',
-    _('The shell command to execute.'), "")
+    _('Mandatory: The shell command to execute.'), "")
 
 def description():
     '''method that is called when salomeTools is called with --help option.
@@ -31,7 +31,8 @@ def description():
     :return: The text to display for the shell command description.
     :rtype: str
     '''
-    return _("Executes the shell command passed as argument")
+    return _("Executes the shell command passed as argument.\n\nexample:"
+             "\nsat shell --command \"ls \\-l /tmp\"")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with shell parameter.
@@ -39,7 +40,13 @@ def run(args, runner, logger):
     
     # Parse the options
     (options, args) = parser.parse_args(args)
-      
+
+    # Make sure the command option has been called
+    if not options.command:
+        message = _("The option --command is required\n")      
+        logger.write(src.printcolors.printcError(message))
+        return 1
+
     res = subprocess.call(options.command,
                           shell=True,
                           stdout=logger.logTxtFile,
index 8ca970d57e8c8c92ccb67917c4b444a99d02fefc..b40a6b4f3c962fafe2eae80a1136e9a32cc51750 100644 (file)
@@ -25,7 +25,7 @@ import prepare
 # Define all possible option for patch command :  sat patch <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products from which to get the sources. This option can be'
+    _('Optional: products from which to get the sources. This option can be'
     ' passed several time to get the sources of several products.'))
 
 def get_source_for_dev(config, product_info, source_dir, logger, pad):
@@ -464,7 +464,8 @@ def description():
     :rtype: str
     '''
     return _("The source command gets the sources of the application products "
-             "from cvs, git, an archive or a directory..")
+             "from cvs, git or an archive.\n\nexample:"
+             "\nsat source SALOME-master --products KERNEL,GUI")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with source parameter.
index c7cfb32e6ac70f6a1805f7db7eb6bf30a5830079..142bdb608fce6a9984b375546a242f4389fa7a3f 100644 (file)
@@ -34,21 +34,21 @@ except NameError:
 
 parser = src.options.Options()
 parser.add_option('n', 'name', 'string', 'name',
-    _("""REQUIRED the name of the module to create.
+    _("""REQUIRED: the name of the module to create.
 \tThe name must be a single word in upper case with only alphanumeric characters.
 \tWhen generating a c++ component the module's """
 """name must be suffixed with 'CPP'."""))
 parser.add_option('t', 'template', 'string', 'template',
-    _('REQUIRED the template to use.'))
+    _('REQUIRED: the template to use.'))
 parser.add_option('', 'target', 'string', 'target',
-    _('REQUIRED where to create the module.'))
+    _('REQUIRED: where to create the module.'))
 parser.add_option('', 'param', 'string', 'param',
-    _('''dictionary to generate the configuration for salomeTools.
+    _('''Optional: dictionary to generate the configuration for salomeTools.
 \tFormat is: --param param1=value1,param2=value2... without spaces
 \tNote that when using this option you must supply all the '''
 '''values otherwise an error will be raised.'''))
 parser.add_option('', 'info', 'boolean', 'info',
-    _('Get information on the template.'), False)
+    _('Optional: Get information on the template.'), False)
 
 class TParam:
     def __init__(self, param_def, compo_name, dico=None):
@@ -431,8 +431,9 @@ def get_template_info(config, template_name, logger):
 ##
 # Describes the command
 def description():
-    return _("""The template command creates the sources for a SALOME """
-             """module from a template.""")
+    return _("The template command creates the sources for a SALOME "
+             "module from a template.\n\nexample\nsat template "
+             "--name my_product_name --template PythonComponent --target /tmp")
 
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with template parameter.
index 3b17e55ac31b88cf543351ac4eadc74f6ca5b817..3bdcd8a6e55a3116006d74c6b30201bcb9c5f348 100644 (file)
@@ -35,18 +35,20 @@ from src.xmlManager import add_simple_node
 # Define all possible option for the test command :  sat test <options>
 parser = src.options.Options()
 parser.add_option('b', 'base', 'string', 'base',
-    _("Indicate the name of the test base to use.\n\tThis name has to be "
-      "registered in your application and in a project.\n\tA path to a test "
-      "base can also be used."))
+    _("Optional: Indicate the name of the test base to use.\n\tThis name has to"
+      " be registered in your application and in a project.\n\tA path to a "
+      "test base can also be used."))
 parser.add_option('l', 'launcher', 'string', 'launcher',
-    _("Use this option to specify the path to a SALOME launcher to use to "
-      "launch the test scripts of the test base."))
+    _("Optional: Use this option to specify the path to a SALOME launcher to "
+      "use to launch the test scripts of the test base."))
 parser.add_option('g', 'grid', 'list', 'grids',
-    _('Indicate which grid(s) to test (subdirectory of the test base).'))
+    _('Optional: Indicate which grid(s) to test (subdirectory of the test '
+      'base).'))
 parser.add_option('s', 'session', 'list', 'sessions',
-    _('Indicate which session(s) to test (subdirectory of the grid).'))
+    _('Optional: indicate which session(s) to test (subdirectory of the '
+      'grid).'))
 parser.add_option('', 'display', 'string', 'display',
-    _("Set the display where to launch SALOME."
+    _("Optional: set the display where to launch SALOME."
 "\tIf value is NO then option --show-desktop=0 will be used to launch SALOME."))
 
 def description():
@@ -55,7 +57,8 @@ def description():
     :return: The text to display for the test command description.
     :rtype: str
     '''
-    return _("The test command runs a test base on a SALOME installation.")     
+    return _("The test command runs a test base on a SALOME installation.\n\n"
+             "example:\nsat test SALOME-master --grid GEOM --session light")     
 
 def parse_option(args, config):
     """ Parse the options and do some verifications about it
index 9146376b5d9b409568ab30b5851fce03c09eb908..ed6770152e2b8ba4ace58decf3d696d3f900cbe2 100644 (file)
@@ -43,7 +43,7 @@ class TestTest(unittest.TestCase):
         sat = Sat("-l " + tmp_file)
         
         # Execute the job command
-        sat.test(application + " --module GEOM --type light" )
+        sat.test(application + " --grid GEOM --session light" )
 
         ff = open(tmp_file, "r")
         log_files = ff.readlines()
@@ -53,7 +53,7 @@ class TestTest(unittest.TestCase):
         
         text = open(log_testboard[0], "r").read()
 
-        if '<type name="light">' in text:
+        if '<session name="light">' in text:
             OK = 'OK'         
         # pyunit method to compare 2 str
         self.assertEqual(OK, 'OK')
@@ -68,7 +68,7 @@ class TestTest(unittest.TestCase):
         sat = Sat("-l " + tmp_file)
         
         # Execute the job command
-        sat.test(application + " --module MED --type PY_test_withKernel" )
+        sat.test(application + " --grid MED --session PY_test_withKernel" )
 
         ff = open(tmp_file, "r")
         log_files = ff.readlines()
@@ -78,7 +78,7 @@ class TestTest(unittest.TestCase):
         
         text = open(log_testboard[0], "r").read()
 
-        if '<type name="light">' in text:
+        if '<session name="PY_test_withKernel">' in text:
             OK = 'OK'         
         # pyunit method to compare 2 str
         self.assertEqual(OK, 'OK')