Index: /CMT/HEAD/ChangeLog
===================================================================
--- /CMT/HEAD/ChangeLog	(revision 589)
+++ /CMT/HEAD/ChangeLog	(revision 590)
@@ -1,2 +1,12 @@
+2011-11-28    <rybkin@lal.in2p3.fr> 467
+
+	* source/cmt_generators.cxx: In class DependencyGenerator, function build,
+	make constituent name optional for command cmt build dependencies
+	* source/cmt_commands.cxx: Update command help info, in class CommandHelp,
+	functions show, show_all, print help info on stdout (rather than stderr)
+	* mgr/fragments/dependencies: Specify constituent name via option value
+	* source/cmt_vcs.cxx: In class Vcs, function help, print help info on
+	stdout (rather than stderr)
+	
 2011-11-28    <rybkin@lal.in2p3.fr> 466
 
Index: /CMT/HEAD/mgr/fragments/dependencies
===================================================================
--- /CMT/HEAD/mgr/fragments/dependencies	(revision 589)
+++ /CMT/HEAD/mgr/fragments/dependencies	(revision 590)
@@ -5,5 +5,5 @@
 $(bin)${CONSTITUENT}_dependencies.make : $(use_requirements) $(cmt_final_setup_${CONSTITUENT})
 	$(echo) "(${CONSTITUENT}.make) Rebuilding $@"; \
-	  $(build_dependencies) -out=$@ -start_all ${LINE} -end_all $(includes) $(app_${CONSTITUENT}_cppflags) $(lib_${CONSTITUENT}_cppflags) ${CONSTITUENT} $? -f=$(cmt_dependencies_in_${CONSTITUENT}) -without_cmt
+	  $(build_dependencies) -out=$@ -start_all ${LINE} -end_all $(includes) $(app_${CONSTITUENT}_cppflags) $(lib_${CONSTITUENT}_cppflags) -name=${CONSTITUENT} $? -f=$(cmt_dependencies_in_${CONSTITUENT}) -without_cmt
 
 -include $(bin)${CONSTITUENT}_dependencies.make
Index: /CMT/HEAD/source/cmt_commands.cxx
===================================================================
--- /CMT/HEAD/source/cmt_commands.cxx	(revision 589)
+++ /CMT/HEAD/source/cmt_commands.cxx	(revision 590)
@@ -2327,6 +2327,6 @@
   static HelpTexts& help_texts = get_help_texts ();
 
-  cerr << "#> cmt command [option...]" << endl;
-  cerr << "# command :" << endl;
+  cout << "#> cmt command [option...]" << endl;
+  cout << "# command :" << endl;
 
   int i;
@@ -2336,26 +2336,26 @@
       const cmt_string& s = help_texts[i];
       if (s == "") break;
-      cerr << "#   " << s << endl;
-    }
-
-  cerr << "# global options :" << endl;
-
-  cerr << "#   -disable_warnings       : don't print warnings" << endl;
-  cerr << "#   -quiet                  : don't print errors" << endl;
-  cerr << "#   -use=<p>:<v>:<path>     : set package version path" << endl;
-  cerr << "#   -pack=<package>         : set package" << endl;
-  cerr << "#   -version=<version>      : set version" << endl;
-  cerr << "#   -path=<path>            : set root path" << endl;
-  cerr << "#   -f=<requirements-file>  : set input file" << endl;
-  cerr << "#   -e=<statement>          : add a one line statement" << endl;
-  cerr << "#   -tag=<tag-list>         : select a new tag-set" << endl;
-  cerr << "#   -tag_add=<tag-list>     : add specific comma-separated tag(s)" << endl;
-  cerr << "#   -tag_remove=<tag-list>  : remove specific comma-separated tag(s)" << endl;
-  cerr << "#   -warnings               : display various warnings" << endl;
-  cerr << "#   -with_version_directory : reset to default structuring style" << endl;
-  cerr << "#   -without_version_directory : switch structuring style" << endl;
-  cerr << "#   -cleanup                : activate install area cleanup" << endl;
-  cerr << "#   -no_cleanup             : inhibit install area cleanup" << endl;
-  cerr << "#   -xml                    : output in XML format (cmt setup, cmt show projects, cmt show uses)" << endl;
+      cout << "#   " << s << endl;
+    }
+
+  cout << "# global options :" << endl;
+
+  cout << "#   -disable_warnings       : don't print warnings" << endl;
+  cout << "#   -quiet                  : don't print errors" << endl;
+  cout << "#   -use=<p>:<v>:<path>     : set package version path" << endl;
+  cout << "#   -pack=<package>         : set package" << endl;
+  cout << "#   -version=<version>      : set version" << endl;
+  cout << "#   -path=<path>            : set root path" << endl;
+  cout << "#   -f=<requirements-file>  : set input file" << endl;
+  cout << "#   -e=<statement>          : add a one line statement" << endl;
+  cout << "#   -tag=<tag-list>         : select a new tag-set" << endl;
+  cout << "#   -tag_add=<tag-list>     : add specific comma-separated tag(s)" << endl;
+  cout << "#   -tag_remove=<tag-list>  : remove specific comma-separated tag(s)" << endl;
+  cout << "#   -warnings               : display various warnings" << endl;
+  cout << "#   -with_version_directory : reset to default structuring style" << endl;
+  cout << "#   -without_version_directory : switch structuring style" << endl;
+  cout << "#   -cleanup                : activate install area cleanup" << endl;
+  cout << "#   -no_cleanup             : inhibit install area cleanup" << endl;
+  cout << "#   -xml                    : output in XML format (cmt setup, cmt show projects, cmt show uses)" << endl;
 }
 
@@ -2369,5 +2369,5 @@
     {
       const cmt_string& s = get_help_text (action);
-      cerr << "# " << s << endl;
+      cout << "# " << s << endl;
       int i;
 
@@ -2375,5 +2375,5 @@
 	{
 	  const cmt_string& s = help_texts[i];
-	  cerr << "#   " << s << endl;
+	  cout << "#   " << s << endl;
 	}
     }
@@ -2385,5 +2385,5 @@
 	{
 	  const cmt_string& s = help_texts[i];
-	  cerr << "#   " << s << endl;
+	  cout << "#   " << s << endl;
 	}
     }
@@ -2395,5 +2395,5 @@
 	{
 	  const cmt_string& s = help_texts[i];
-	  cerr << "#   " << s << endl;
+	  cout << "#   " << s << endl;
 	}
     }
@@ -2401,5 +2401,5 @@
     {
       const cmt_string& s = get_help_text (action);
-      cerr << "# " << s << endl;
+      cout << "# " << s << endl;
     }
 }
@@ -2429,5 +2429,5 @@
   help_texts.add () =  "build constituents_config [-out=<path>] [-with_cmt] [-without_cmt] : generate constituents Makefile, tag specific Makefile, and setup definitions file, also input requirements file for constituent(s) without associated tag";
   help_texts.add () =  "build broadcast_config [-out=<path>] : generate broadcast Makefile, and broadcast specific macros Makefile";
-  help_texts.add () =  "build dependencies [-out=<path>] [-all_sources] [-no_stamps] [-I<directory>]... [-start_all FILE... -end_all] NAME FILE... : generate dependencies for FILEs of constituent NAME";
+  help_texts.add () =  "build dependencies [-out=<path>] [-name=<constituent>] [-all_sources] [-no_stamps] [-I<directory>]... [-start_all FILE... -end_all] FILE... : generate dependencies for FILEs [of constituent <constituent>]";
   help_texts.add () =  "build library_links     : build symbolic links towards all imported libraries";
   help_texts.add () =  "build make_setup        : build a compiled version of setup scripts";
Index: /CMT/HEAD/source/cmt_generators.cxx
===================================================================
--- /CMT/HEAD/source/cmt_generators.cxx	(revision 589)
+++ /CMT/HEAD/source/cmt_generators.cxx	(revision 590)
@@ -3073,5 +3073,5 @@
   m_deps_builder.clear ();
   m_stamps = true;
-  m_name = "";
+  m_name = "unnamed";
 }
 
@@ -3294,4 +3294,12 @@
 	  m_output_file_name = file_name;
         }
+      else if (file_name.substr (0, 6) == "-name=" ||
+	       file_name.substr (0, 6) == "-name:" ||
+	       file_name.substr (0, 6) == "/name:" ||
+	       file_name.substr (0, 6) == "/name=")
+        {
+	  file_name.erase (0, 6);
+	  m_name = file_name;
+        }
       else if (file_name == "-all_sources" ||
 	       file_name == "/all_sources") 
@@ -3360,12 +3368,7 @@
 	  all.push_back (file_name);
 	}
-      else if (m_name.size () != 0)
+      else
 	{
 	  cli_input.push_back (file_name);
-	}
-      else
-	{
-	  if (file_name.size () != 0)
-	    m_name = file_name;
 	}
     }
@@ -3377,4 +3380,5 @@
 
   //cerr << "m_name: " << m_name << endl;
+  /*
   if (m_name.size () == 0)
     {
@@ -3383,8 +3387,9 @@
       return;
     }
-
+  */
   //cerr << "config_files: " << config_files << endl;
 
-  m_constituent = Constituent::find (m_name);
+  if (0 != m_name.size ())
+    m_constituent = Constituent::find (m_name);
 
   if (!config_files && 0 == cli_input.size () &&
@@ -3482,27 +3487,34 @@
       //   or
       // o m_constituent sources
-      set_source_files (all);
-      if (0 == validate (cli_input))
-	{
-	  // cli_input contains source files ONLY
-	  // calculate dependencies for them ONLY
-	  if (CmtSystem::test_file (m_output_file_name))
+      if (int n = set_source_files (all))
+	{
+	  if (0 == validate (cli_input))
 	    {
-	      if (!dependencies.read (m_output_file_name))
+	      // cli_input contains source files ONLY
+	      // calculate dependencies for them ONLY
+	      if (CmtSystem::test_file (m_output_file_name))
 		{
-		  CmtError::set (CmtError::file_access_error, m_output_file_name);
-		  return;
+		  if (!dependencies.read (m_output_file_name))
+		    {
+		      CmtError::set (CmtError::file_access_error, m_output_file_name);
+		      return;
+		    }
 		}
+	      fill_dependencies (dependencies, cli_input);
 	    }
+	  else
+	    {
+	      all_sources = true;
+	      // calculate dependencies for 
+	      // all cli sources
+	      // or
+	      // m_constituent sources
+	      fill_dependencies (dependencies);
+	    }
+	}
+      else
+	{
+	  // calculate dependencies for all we have
 	  fill_dependencies (dependencies, cli_input);
-	}
-      else
-	{
-	  all_sources = true;
-	  // calculate dependencies for 
-	  // all cli sources
-	  // or
-	  // m_constituent sources
-	  fill_dependencies (dependencies);
 	}
       /*
@@ -3977,5 +3989,5 @@
 //--------------------------------------------------
 /**
- *  Returns 0, if each file in files is found in m_source_files,
+ *  Returns 0, if each file in @files is found in m_source_files,
  *  otherwise returns 1
  */
Index: /CMT/HEAD/source/cmt_vcs.cxx
===================================================================
--- /CMT/HEAD/source/cmt_vcs.cxx	(revision 589)
+++ /CMT/HEAD/source/cmt_vcs.cxx	(revision 590)
@@ -3693,31 +3693,31 @@
 void Vcs::help ()
 {
-  cerr << "Usage:" << endl;
-  cerr << "> cd <some work area>" << endl;
-  cerr << "> cmt co | checkout [modifier]... <package|project>..." << endl;
-  cerr << "" << endl;
-  cerr << "   modifier :" << endl;
-  cerr << "   -l          Do not process used packages (default)." << endl;
-  cerr << "   -R          Process used products recursively." << endl;
-  cerr << "   -r rev      Check out version tag rev (may be HEAD)." << endl;
-  cerr << "   -C          Determine version tag and/or package container from context." << endl;
-  cerr << "   -i          Do not check out, show package(s) information only." << endl;
-  cerr << "   -vd dir     Use this version directory instead of version tag." << endl;
-  cerr << "   -d dir      Check out into dir instead of module name." << endl;
-  cerr << "   -o offset   Offset in the repository" << endl;
-  cerr << "   -requirements <requirements file path>  Check out packages referenced in this requirements file" << endl;
+  cout << "Usage:" << endl;
+  cout << "> cd <some work area>" << endl;
+  cout << "> cmt co | checkout [modifier]... <package|project>..." << endl;
+  cout << "" << endl;
+  cout << "   modifier :" << endl;
+  cout << "   -l          Do not process used packages (default)." << endl;
+  cout << "   -R          Process used products recursively." << endl;
+  cout << "   -r rev      Check out version tag rev (may be HEAD)." << endl;
+  cout << "   -C          Determine version tag and/or package container from context." << endl;
+  cout << "   -i          Do not check out, show package(s) information only." << endl;
+  cout << "   -vd dir     Use this version directory instead of version tag." << endl;
+  cout << "   -d dir      Check out into dir instead of module name." << endl;
+  cout << "   -o offset   Offset in the repository" << endl;
+  cout << "   -requirements <requirements file path>  Check out packages referenced in this requirements file" << endl;
   //cerr << "   -t        Change file timestamps to the date of checkout" << endl;
   //cerr << "   -n        simulation mode on" << endl;
-  cerr << "   -no_config  Disable config step after checkout" << endl;    
+  cout << "   -no_config  Disable config step after checkout" << endl;    
   //cerr << "   -v        verbose mode on" << endl;
-  cerr << "   -rs suffix  Same as -r <packagename|projectname>suffix" << endl;
-  cerr << "   --help      Print this help" << endl;
-  cerr << "" << endl;
-  cerr << "(Modifiers are recognised anywhere on the command line.)" << endl;
+  cout << "   -rs suffix  Same as -r <packagename|projectname>suffix" << endl;
+  cout << "   --help      Print this help" << endl;
+  cout << "" << endl;
+  cout << "(Modifiers are recognised anywhere on the command line.)" << endl;
 //   cerr << "" << endl;
 //   cerr << "> cmt cvstags <package|project>" << endl;
 //   cerr << "> cmt cvssubpackages <directory>" << endl;
 //   cerr << "> cmt cvssubprojects <directory>" << endl;
-  cerr << "" << endl;
+  cout << "" << endl;
 }
 
