Index: trunk/FACT++/src/fitsdump.cc
===================================================================
--- trunk/FACT++/src/fitsdump.cc	(revision 18836)
+++ trunk/FACT++/src/fitsdump.cc	(revision 18837)
@@ -449,5 +449,5 @@
         if (tfile->IsZombie())
         {
-            cerr << "Could not open root file '" << rootfile << "'" << endl;
+            cerr << "Could not open root file '" << filename << "'" << endl;
             return -2;
         }
@@ -492,5 +492,7 @@
         for (auto it=cols.begin(); it!=cols.end(); it++)
         {
-            const string branch = it->name+"["+to_string(it->last-it->first+1)+"]";
+            string branch = it->name;
+            if (it->last!=it->first)
+                branch += "["+to_string(it->last-it->first+1)+"]";
 
             fout << "# Branch: " << branch << "\n";
@@ -1098,5 +1100,13 @@
     // ------------------------------------------------------------
 
-    const string filename = conf.Get<string>("outfile");
+    string filename = conf.Get<string>("outfile");
+
+    if (!filename.empty() && filename[0]=='.')
+    {
+        if (fFilename.rfind(".fits")==fFilename.size()-5)
+            filename.insert(0, fFilename.substr(0, fFilename.size()-5));
+        if (fFilename.rfind(".fits.fz")==fFilename.size()-8)
+            filename.insert(0, fFilename.substr(0, fFilename.size()-8));
+    }
 
     ostream fout(cout.rdbuf());
@@ -1246,5 +1256,5 @@
                                               , "Name of FITS file")
         ("col,c",       vars<string>(),         "List of columns to dump\narg is a list of columns, separated by a space.\nAdditionnally, a list of sub-columns can be added\ne.g. Data[3] will dump sub-column 3 of column Data\nData[3:4] will dump sub-columns 3 and 4\nOmitting this argument dump the entire column\nnote: all indices start at zero")
-        ("outfile,o",   var<string>("-"),       "Name of output file (-:/dev/stdout)")
+        ("outfile,o",   var<string>("-"),       "Name of output file (-:/dev/stdout), if outfile starts with a dot, the extension .fits and .fits.fz are replaced automatically.")
         ("precision,p", var<int>(20),           "Precision of ofstream")
         ("stat,s",      po_switch(),            "Perform statistics instead of dump")
