Index: trunk/BNC/bncgetthread.cpp
===================================================================
--- trunk/BNC/bncgetthread.cpp	(revision 1145)
+++ trunk/BNC/bncgetthread.cpp	(revision 1146)
@@ -507,5 +507,5 @@
       }
       else if (_rawInpFile) {
-        const qint64 maxBytes = 10000;
+        const qint64 maxBytes = 1024;
         nBytes = maxBytes;
       }
@@ -521,5 +521,4 @@
         else if (_rawInpFile) {
           nBytes = _rawInpFile->read(data, nBytes);
-          cout << "nBytes = " << nBytes << endl;
           if (nBytes <= 0) {
             cout << "no more data" << endl;
Index: trunk/BNC/bncmain.cpp
===================================================================
--- trunk/BNC/bncmain.cpp	(revision 1145)
+++ trunk/BNC/bncmain.cpp	(revision 1146)
@@ -59,9 +59,30 @@
 int main(int argc, char *argv[]) {
 
-  bool GUIenabled = true;
+  bool       GUIenabled  = true;
+  bool       fileInput   = false;
+  QByteArray fileName;
+  QByteArray format; 
+
   for (int ii = 1; ii < argc; ii++) {
-    if (QString(argv[ii]) == "-nw") {
+    if (QByteArray(argv[ii]) == "-nw") {
       GUIenabled = false;
       break;
+    }
+  }
+
+  for (int ii = 1; ii < argc; ii++) {
+    if (QByteArray(argv[ii]) == "-file" || QByteArray(argv[ii]) == "--file") {
+      GUIenabled = false;
+      fileInput  = true;
+      if (ii+1 < argc) {
+        fileName = QByteArray(argv[ii+1]);
+      }
+    }
+    if (QByteArray(argv[ii]) == "-format" || QByteArray(argv[ii]) == "--format") {
+      GUIenabled = false;
+      fileInput  = true;
+      if (ii+1 < argc) {
+        format = QByteArray(argv[ii+1]);
+      }
     }
   }
@@ -130,6 +151,11 @@
     ((bncApp*)qApp)->slotMessage("============ Start BNC ============");
 
-    if (false) {
-      bncGetThread* getThread = new bncGetThread("SASS0.raw","RTCM_3");
+    if (fileInput) {
+      if (fileName.isEmpty() || format.isEmpty()) {
+        cout << "Usage: bnc --file <fileName> --format <RTIGS | RTCM_2 | RTCM_3>" << endl;
+        exit(0);
+      }
+
+      bncGetThread* getThread = new bncGetThread(fileName, format);
       app.connect(getThread, SIGNAL(newMessage(QByteArray)), 
                   &app, SLOT(slotMessage(const QByteArray)));
