Index: uspace/app/pcapctl/main.c
===================================================================
--- uspace/app/pcapctl/main.c	(revision 31d2aeee10d6cd21b90def54db9987b00f3ea4b8)
+++ uspace/app/pcapctl/main.c	(revision 28ed2d895c391b0a614fa176129126725c0fac4b)
@@ -38,4 +38,5 @@
 #include <arg_parse.h>
 #include <getopt.h>
+#include <vfs/vfs.h>
 
 #include "pcapdump_client.h"
@@ -43,4 +44,5 @@
 #define NAME "pcapctl"
 #define DEFAULT_DEV_NUM 0
+#define DEFAULT_OPS_NUM 0
 #define DECIMAL_SYSTEM 10
 
@@ -96,10 +98,21 @@
 	{ "list", no_argument, 0, 'l' },
 	{ "help", no_argument, 0, 'h' },
-	{ "outfile", required_argument, 0, 'f' },
+	{ "outfile", required_argument, 0, 'o' },
 	{ "start", no_argument, 0, 'r' },
 	{ "stop", no_argument, 0, 't' },
-	{ "ops", required_argument, 0, 'o' },
+	{ "ops", required_argument, 0, 'p' },
+	{ "force", no_argument, 0, 'f'},
 	{ 0, 0, 0, 0 }
 };
+
+static bool file_exists(const char *path)
+{
+	vfs_stat_t stats;
+
+    if (vfs_stat_path(path, &stats) != EOK)
+        return false;
+
+    return true;
+}
 
 static void usage(void)
@@ -122,6 +135,7 @@
 	bool start = false;
 	bool stop = false;
-	int dev_number = -1;
-	int ops_number = -1;
+	int dev_number = DEFAULT_DEV_NUM;
+	int ops_number = DEFAULT_OPS_NUM;
+	bool forced = false;
 	const char *output_file_name = "";
 	int idx = 0;
@@ -132,5 +146,5 @@
 	}
 	while (ret != -1) {
-		ret = getopt_long(argc, argv, "d:lhf:rt", opts, &idx);
+		ret = getopt_long(argc, argv, "d:lho:rtp:f", opts, &idx);
 		switch (ret) {
 		case 'd':
@@ -150,5 +164,5 @@
 			usage();
 			return 0;
-		case 'f':
+		case 'o':
 			output_file_name = optarg;
 			break;
@@ -159,9 +173,12 @@
 			stop = true;
 			break;
-		case 'o':
+		case 'p':
 			char* ops_inval;
 			long ops_result = strtol(optarg, &ops_inval, DECIMAL_SYSTEM);
 			ops_number = (int)ops_result;
 			break;
+		case 'f':
+			forced = true;
+			break;
 		}
 	}
@@ -170,4 +187,11 @@
 
 	if (start) {
+
+		if (file_exists(output_file_name) && !forced)
+		{
+			printf("File %s already exists. If you want to write to it, then use flag --force.\n", output_file_name);
+			return 0;
+		}
+
 		/* start with dev number and name */
 		start_dumping(&dev_number, output_file_name, &ops_number);
@@ -175,4 +199,6 @@
 		/* stop with dev number */
 		stop_dumping(&dev_number);
+	} else {
+		usage();
 	}
 	return 0;
