Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -324,5 +324,5 @@
 	argc = cli_count_args(argv);
 
-	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
+	for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
 		c = getopt_long(argc, argv, "xhvmH:t:b:s:n", long_options, &opt_ind);
 		switch (c) {
Index: uspace/app/bdsh/cmds/modules/cmp/cmp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cmp/cmp.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/cmp/cmp.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -130,5 +130,5 @@
 	argc = cli_count_args(argv);
 
-	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
+	for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
 		c = getopt_long(argc, argv, "hv", long_options, &opt_ind);
 		switch (c) {
Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -457,5 +457,5 @@
 	argc = cli_count_args(argv);
 
-	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
+	for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
 		c = getopt_long(argc, argv, "hvVfirb:", long_options, &opt_ind);
 		switch (c) { 
Index: uspace/app/bdsh/cmds/modules/ls/ls.c
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -362,5 +362,5 @@
 	argc = cli_count_args(argv);
 	
-	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
+	for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
 		c = getopt_long(argc, argv, "hur", long_options, &opt_ind);
 		switch (c) {
Index: uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -173,5 +173,5 @@
 	argc = cli_count_args(argv);
 
-	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
+	for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
 		c = getopt_long(argc, argv, "pvhVfm:", long_options, &opt_ind);
 		switch (c) {
Index: uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -126,5 +126,5 @@
 	argc = cli_count_args(argv);
 
-	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
+	for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
 		c = getopt_long(argc, argv, "ps:h", long_options, &opt_ind);
 		switch (c) {
Index: uspace/app/bdsh/cmds/modules/mount/mount.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mount/mount.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/mount/mount.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -117,5 +117,5 @@
 	argc = cli_count_args(argv);
 
-	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
+	for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
 		c = getopt_long(argc, argv, "i:h", long_options, &opt_ind);
 		switch (c) {
Index: uspace/app/bdsh/cmds/modules/rm/rm.c
===================================================================
--- uspace/app/bdsh/cmds/modules/rm/rm.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/rm/rm.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -261,5 +261,5 @@
 	}
 
-	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
+	for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
 		c = getopt_long(argc, argv, "hvrfs", long_options, &opt_ind);
 		switch (c) {
Index: uspace/app/bdsh/cmds/modules/touch/touch.c
===================================================================
--- uspace/app/bdsh/cmds/modules/touch/touch.c	(revision dcba81992b1e3b37a4ec931392dd5e0a9a8e21fe)
+++ uspace/app/bdsh/cmds/modules/touch/touch.c	(revision 86cf96db61d51787a47d6d8c6ac8e3d1961b743d)
@@ -90,5 +90,5 @@
 	DIR *dirp;
 	
-	for (c = 0, optind = 0, longind = 0; c != -1; ) {
+	for (c = 0, optreset = 1, optind = 0, longind = 0; c != -1; ) {
 		c = getopt_long(argc, argv, "c", long_options, &longind);
 		switch (c) {
