Index: trunk/MagicSoft/Mars/mbase/MArgs.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MArgs.cc	(revision 9079)
+++ trunk/MagicSoft/Mars/mbase/MArgs.cc	(revision 9141)
@@ -31,5 +31,9 @@
 //
 // Arguments beginning with a trailing '-' are called 'options'.
+//
 // Arguments without a trailing '-' are considered 'arguments'
+//
+// All arguments appearing after '--' on the commandline are
+//  also cosidered as 'arguments'
 //
 //////////////////////////////////////////////////////////////////////////////
@@ -57,8 +61,5 @@
 //  fArgv: A TList containing all other command line arguments
 //
-//  If root==kFALSE all root commandline options are deleted from
-//  the list, namely: -b
-//
-MArgs::MArgs(int argc, char **argv, Bool_t root) : fArgc(argc)
+MArgs::MArgs(int argc, char **argv) : fArgc(argc)
 {
     TString cmdline;
@@ -76,9 +77,27 @@
         fArgv.Add(new MArgsEntry(argv[i]));
     }
-
-    if (root)
-        return;
-
-    HasOnlyAndRemove("-b");
+}
+
+// --------------------------------------------------------------------------
+//
+//  Remove all root commandline options from the list,
+//  namely: -b, -n, -q, -l, -?, -h, --help, -config
+//
+//  Returns the number of found root options (max 8)
+//
+Int_t MArgs::RemoveRootArgs()
+{
+    Int_t n = 0;
+
+    n += HasOnlyAndRemove("-b");
+    n += HasOnlyAndRemove("-n");
+    n += HasOnlyAndRemove("-q");
+    n += HasOnlyAndRemove("-l");
+    n += HasOnlyAndRemove("-?");
+    n += HasOnlyAndRemove("-h");
+    n += HasOnlyAndRemove("--help");
+    n += HasOnlyAndRemove("-config");
+
+    return n;
 }
 
@@ -109,5 +128,5 @@
         TString *s = NULL;
         while ((s=dynamic_cast<TString*>(Next())))
-            if (s->BeginsWith("-"))
+            if (*s!="--" && s->BeginsWith("-"))
                 gLog << *s << endl;
         return;
@@ -119,5 +138,5 @@
         TString *s = NULL;
         while ((s=dynamic_cast<TString*>(Next())))
-            if (!s->BeginsWith("-"))
+            if (*s!="--" && !s->BeginsWith("-"))
                 gLog << *s << endl;
         return;
@@ -283,9 +302,17 @@
     Int_t num = 0;
 
-    TIter Next(&fArgv);
-    TString *s = NULL;
-    while ((s=dynamic_cast<TString*>(Next())))
-    {
-        if (s->BeginsWith("-"))
+    Bool_t allarg = kFALSE;
+
+    TIter Next(&fArgv);
+    TString *s = NULL;
+    while ((s=dynamic_cast<TString*>(Next())))
+    {
+        if (*s=="--")
+        {
+            allarg = kTRUE;
+            continue;
+        }
+
+        if (s->BeginsWith("-") && !allarg)
             continue;
 
@@ -305,9 +332,21 @@
     Int_t num = 0;
 
-    TIter Next(&fArgv);
-    TString *s = NULL;
-    while ((s=dynamic_cast<TString*>(Next())))
-        if (!s->BeginsWith("-"))
-            num++;
+    Bool_t allarg = kFALSE;
+
+    TIter Next(&fArgv);
+    TString *s = NULL;
+    while ((s=dynamic_cast<TString*>(Next())))
+    {
+        if (*s=="--")
+        {
+            allarg = kTRUE;
+            continue;
+        }
+
+        if (s->BeginsWith("-") && !allarg)
+            continue;
+
+        num++;
+    }
 
     return num;
@@ -325,6 +364,11 @@
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
+    {
+        if (*s=="--")
+            return num;
+
         if (s->BeginsWith("-"))
             num++;
+    }
 
     return num;
@@ -337,5 +381,5 @@
 Int_t MArgs::GetNumEntries() const
 {
-    return fArgv.GetSize();
+    return fArgv.FindObject("--") ? fArgv.GetSize()-1 : fArgv.GetSize();
 }
 
Index: trunk/MagicSoft/Mars/mbase/MArgs.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MArgs.h	(revision 9079)
+++ trunk/MagicSoft/Mars/mbase/MArgs.h	(revision 9141)
@@ -31,5 +31,5 @@
 
 public:
-    MArgs(int argc, char **argv, Bool_t root=kFALSE);
+    MArgs(int argc, char **argv);
 
     // TObject
@@ -40,4 +40,6 @@
 
     // MArgs
+    Int_t    RemoveRootArgs();
+
     Int_t    GetInt(const TString name) const;
     Double_t GetFloat(const TString name) const;
