Index: CMT/HEAD/source/cmt_commands.cxx
===================================================================
--- CMT/HEAD/source/cmt_commands.cxx	(revision 649)
+++ CMT/HEAD/source/cmt_commands.cxx	(revision 652)
@@ -1903,6 +1903,8 @@
 {
   cmt.m_disable_warnings = true;
-  if (CmtMessage::level () <= Warning)
-    CmtMessage::set_level (Error);
+//   if (CmtMessage::level () <= Warning)
+//     CmtMessage::set_level (Error);
+  if (!Cmt::add_cmt_flag ("-disable_warnings"))
+    CmtError::set (CmtError::system_error, "Cannot add flag `-disable_warnings'");
 }
 
@@ -1910,6 +1912,8 @@
 {
   cmt.m_quiet = true;
-  if (CmtMessage::level () <= Error)
-    CmtMessage::set_level (Fatal);
+//   if (CmtMessage::level () <= Error)
+//     CmtMessage::set_level (Fatal);
+  if (!Cmt::add_cmt_flag ("-quiet"))
+    CmtError::set (CmtError::system_error, "Cannot add flag `-quiet'");
 }
 
@@ -1918,6 +1922,8 @@
 {
   cmt.m_warnings = true;
-  if (CmtMessage::level () != Warning)
-    CmtMessage::set_level (Warning);
+//   if (CmtMessage::level () != Warning)
+//     CmtMessage::set_level (Warning);
+  if (!Cmt::add_cmt_flag ("-warnings"))
+    CmtError::set (CmtError::system_error, "Cannot add flag `-warnings'");
 }
 
@@ -1963,27 +1969,4 @@
       if (words.size () > 1) cmt.m_current_version = words[1];
       if (words.size () > 2) cmt.m_current_path    = words[2];
-      (Use::current()).set (cmt.m_current_package, 
-			    cmt.m_current_version, 
-			    cmt.m_current_path);
-
-      Use& use = Use::current();
-      if (use.get_package_name () == "cmt_standalone")
-	{
-          if (!CmtSystem::cd (use.path) || !CmtSystem::test_file ("requirements"))
-            {
-	      CmtError::set (CmtError::package_not_found, use.get_info ());
-	      return;
-	    }
-	  use.style = none_style;
-	  use.structuring_style = without_version_directory;
-	  use.change_path (CmtSystem::pwd ());
-	}
-      else if (!use.move_to ())
-	{
-	  CmtError::set (CmtError::package_not_found, use.get_info ());
-	  return;
-	}
-      Project::order_all ();
-      Cmt::guess_current_project ();
     }
 }
@@ -1998,16 +1981,6 @@
 
       cmt.m_current_package = arg;
-      cmt.m_current_version = "";
-
-      /*
-      cerr << "ArgParser::option_pack> "
-	   << " cp=" << cmt.m_current_package
-	   << " cv=" << cmt.m_current_version
-	   << " cp=" << cmt.m_current_path << endl;
-      */
-
-      (Use::current()).set (cmt.m_current_package, 
-			    cmt.m_current_version, 
-			    cmt.m_current_path);
+      //      cmt.m_current_version = "";
+
     }
 }
@@ -2019,15 +1992,4 @@
       cmt.m_current_access = UserMode;
       cmt.m_current_version = arg;
-
-      /*
-      cerr << "ArgParser::option_version> "
-	   << " cp=" << cmt.m_current_package
-	   << " cv=" << cmt.m_current_version
-	   << " cp=" << cmt.m_current_path << endl;
-      */
-
-      (Use::current()).set (cmt.m_current_package, 
-			    cmt.m_current_version, 
-			    cmt.m_current_path);
     }
 }
@@ -2039,37 +2001,4 @@
       cmt.m_current_access = UserMode;
       cmt.m_current_path = arg;
-
-      /*
-      cerr << "ArgParser::option_path> "
-	   << " cp=" << cmt.m_current_package
-	   << " cv=" << cmt.m_current_version
-	   << " cp=" << cmt.m_current_path << endl;
-      */
-
-      (Use::current()).set (cmt.m_current_package, 
-			    cmt.m_current_version, 
-			    cmt.m_current_path);
-
-      //IProjectFactory& factory = ProjectFactory::instance ();
-      //CmtSystem::add_cmt_path (cmt.m_current_path, "argument", factory);
-      Use& use = Use::current();
-      if (use.get_package_name () == "cmt_standalone")
-	{
-          if (!CmtSystem::cd (use.path) || !CmtSystem::test_file ("requirements"))
-            {
-	      CmtError::set (CmtError::package_not_found, use.get_info ());
-	      return;
-	    }
-	  use.style = none_style;
-	  use.structuring_style = without_version_directory;
-	  use.change_path (CmtSystem::pwd ());
-	}
-      else if (!use.move_to ())
-	{
-	  CmtError::set (CmtError::package_not_found, use.get_info ());
-	  return;
-	}
-      Project::order_all ();
-      Cmt::guess_current_project ();
     }
 }
@@ -2082,5 +2011,4 @@
 void ArgParser::option_e ()
 {
-  //CmtMessage::warning ("extra statement = " + arg);
   extra_line = arg;
 }
@@ -2101,4 +2029,30 @@
   if (arg != "")
     {
+      cmt.m_tags.clear ();
+      CmtSystem::cmt_string_vector words;
+      CmtSystem::split (arg, " \t,", words);
+      for (int i = 0; i < words.size (); i++)
+	{
+	  bool has (false);
+	  for (int j = 0; j < cmt.m_tags.size (); j++)
+	    {
+	      if (cmt.m_tags[j] == words[i])
+		{
+		  has = true;
+		  break;
+		}
+	    }
+	  if (!has)
+	    cmt.m_tags.push_back (words[i]);
+	}
+
+      if (cmt.m_tags.size () != 0)
+	{
+	  cmt.m_extra_tags.clear ();
+	  cmt.m_tags_add.clear ();
+	  cmt.m_tags_remove.clear ();
+	}
+
+      /*
       Tag* tag;
       CmtSystem::cmt_string_vector words;
@@ -2154,4 +2108,5 @@
 	// To be sure that a tag
 	Cmt::guess_current_project ();
+      */
     }
 }
@@ -2159,4 +2114,32 @@
 void ArgParser::option_tag_add ()
 {
+  CmtSystem::cmt_string_vector words;
+  CmtSystem::split (arg, " \t,", words);
+  for (int i = 0; i < words.size (); i++)
+    {
+      bool has (false);
+      for (int j = 0; j < cmt.m_tags_add.size (); j++)
+	{
+	  if (cmt.m_tags_add[j] == words[i])
+	    {
+	      has = true;
+	      break;
+	    }
+	}
+      if (!has)
+	{
+	  cmt.m_tags_add.push_back (words[i]);
+	}
+      
+      for (int j = 0; j < cmt.m_tags_remove.size (); j++)
+	{
+	  if (cmt.m_tags_remove[j] == words[i])
+	    {
+	      cmt.m_tags_remove.erase(j);
+	      break;
+	    }
+	}
+    }
+  /*
   Tag* tag;
   CmtSystem::cmt_string_vector words;
@@ -2191,23 +2174,56 @@
 	}
     }
+  */
 }
 
 void ArgParser::option_tag_remove ()
 {
+  CmtSystem::cmt_string_vector words;
+  CmtSystem::split (arg, " \t,", words);
+  for (int i = 0; i < words.size (); i++)
+    {
+      bool has (false);
+      for (int j = 0; j < cmt.m_tags_remove.size (); j++)
+	{
+	  if (cmt.m_tags_remove[j] == words[i])
+	    {
+	      has = true;
+	      break;
+	    }
+	}
+      if (!has)
+	{
+	  cmt.m_tags_remove.push_back (words[i]);
+	}
+
+      for (int j = 0; j < cmt.m_extra_tags.size (); j++)
+	{
+	  if (cmt.m_extra_tags[j] == words[i])
+	    {
+	      cmt.m_extra_tags.erase(j);
+	      break;
+	    }
+	}
+      for (int j = 0; j < cmt.m_tags.size (); j++)
+	{
+	  if (cmt.m_tags[j] == words[i])
+	    {
+	      cmt.m_tags.erase(j);
+	      break;
+	    }
+	}
+      for (int j = 0; j < cmt.m_tags_add.size (); j++)
+	{
+	  if (cmt.m_tags_add[j] == words[i])
+	    {
+	      cmt.m_tags_add.erase(j);
+	      break;
+	    }
+	}
+    }
+  /*
   Tag::TagPtrVector tags = Tag::tags ();
   int i;
   Tag* tag;
-
-  /*
-    for (i = 0; i < tags.size (); i++)
-    {
-    tag = tags[i];
-    if ((tag != 0) &&
-    (tag->selected))
-    {
-    if (!cmt.m_quiet) cerr << "  original tag_list=" << tag->name << tag->priority << endl;
-    }
-    }
-  */
 
   CmtSystem::cmt_string_vector words;
@@ -2262,6 +2278,4 @@
 	    const cmt_string& a = words[i];
 
-	    //fprintf (stderr, "  a=[%s]\n", a.c_str ());
-
 	    /// Then restore uname if the specified tag is CMTCONFIG
 	      if (a == CmtSystem::get_cmt_config ())
@@ -2286,4 +2300,5 @@
 	      tag->mark ("arguments");
 	  }
+  */
 }
 
@@ -2314,10 +2329,7 @@
   cmt.m_current_structuring_style = with_version_directory;
 
-  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
-  if (def != 0)
-    {
-      def->m_default_value = true;
-      def->m_priority_value = false;
-    }
+  if (!Cmt::add_cmt_flag ("-with_version_directory"))
+    CmtError::set (CmtError::system_error, "Cannot add flag `-with_version_directory'");
+
 }
 
@@ -2326,10 +2338,7 @@
   cmt.m_current_structuring_style = without_version_directory;
 
-  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
-  if (def != 0)
-    {
-      def->m_default_value = false;
-      def->m_priority_value = true;
-    }
+  if (!Cmt::add_cmt_flag ("-without_version_directory"))
+    CmtError::set (CmtError::system_error, "Cannot add flag `-without_version_directory'");
+
 }
 
@@ -2401,5 +2410,5 @@
   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 << "#   -e=<statement(s)>       : add (multiple) statement(s)" << endl;
   cout << "#   -tag=<tag-list>         : select a new tag-set" << endl;
   cout << "#   -tag_add=<tag-list>     : add specific comma-separated tag(s)" << endl;
@@ -2411,4 +2420,6 @@
   cout << "#   -no_cleanup             : inhibit install area cleanup" << endl;
   cout << "#   -xml                    : output in XML format (cmt setup, cmt show projects, cmt show uses)" << endl;
+  cout << "#   -user_context=<path>    : set user context package/project directory" << endl;
+  cout << "#   -home=<path>            : set home package/project directory" << endl;
 }
 
