diff mbox series

fstests: Fix duplicate CLI arguments in fssum

Message ID 20200428075300.3037-1-raghavan.arvind@gmail.com (mailing list archive)
State New, archived
Headers show
Series fstests: Fix duplicate CLI arguments in fssum | expand

Commit Message

Arvind Raghavan April 28, 2020, 7:53 a.m. UTC
fssum currently has a duplicate '-x' flag. This patch renames one of the
duplicate flags and makes the appropriate doc changes.

Signed-off-by: Arvind Raghavan <raghavan.arvind@gmail.com>
Signed-off-by: Jayashree Mohan <jaya@cs.utexas.edu>
Signed-off-by: Vijay Chidambaram <vijay@cs.utexas.edu>
---
 src/fssum.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Arvind Raghavan April 30, 2020, 12:11 a.m. UTC | #1
Looking around the xfstest repo, I realized that there are in fact
test cases that use the '-x' flag in fssum to exclude paths, so
this patch breaks them. I'll send out a V2 that preserves the
behavior of '-x' and renames the other flag.

On Tue, Apr 28, 2020 at 1:28 PM Arvind Raghavan
<raghavan.arvind@gmail.com> wrote:
>
> fssum currently has a duplicate '-x' flag. This patch renames one of the
> duplicate flags and makes the appropriate doc changes.
>
> Signed-off-by: Arvind Raghavan <raghavan.arvind@gmail.com>
> Signed-off-by: Jayashree Mohan <jaya@cs.utexas.edu>
> Signed-off-by: Vijay Chidambaram <vijay@cs.utexas.edu>
> ---
>  src/fssum.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/src/fssum.c b/src/fssum.c
> index a243839a..b49ba59b 100644
> --- a/src/fssum.c
> +++ b/src/fssum.c
> @@ -150,9 +150,9 @@ usage(void)
>         fprintf(stderr, "    -[UGOAMCDXES]: exclude respective field from calculation\n");
>         fprintf(stderr, "    -n          : reset all flags\n");
>         fprintf(stderr, "    -N          : set all flags\n");
> -       fprintf(stderr, "    -x path     : exclude path when building checksum (multiple ok)\n");
> +       fprintf(stderr, "    -i path     : ignore path when building checksum (multiple ok)\n");
>         fprintf(stderr, "    -h          : this help\n\n");
> -       fprintf(stderr, "The default field mask is ugoamCdES. If the checksum/manifest is read from a\n");
> +       fprintf(stderr, "The default field mask is ugoamCdxES. If the checksum/manifest is read from a\n");
>         fprintf(stderr, "file, the mask is taken from there and the values given on the command line\n");
>         fprintf(stderr, "are ignored.\n");
>         exit(-1);
> @@ -713,7 +713,7 @@ main(int argc, char *argv[])
>         int plen;
>         int elen;
>         int n_flags = 0;
> -       const char *allopts = "heEfuUgGoOaAmMcCdDsSnNw:r:vx:";
> +       const char *allopts = "heEfuUgGoOaAmMcCdDxXsSnNw:r:vi:";
>
>         out_fp = stdout;
>         while ((c = getopt(argc, argv, allopts)) != EOF) {
> @@ -735,6 +735,8 @@ main(int argc, char *argv[])
>                 case 'C':
>                 case 'd':
>                 case 'D':
> +               case 'x':
> +               case 'X':
>                 case 'e':
>                 case 'E':
>                 case 's':
> @@ -768,7 +770,7 @@ main(int argc, char *argv[])
>                                 exit(-1);
>                         }
>                         break;
> -               case 'x':
> +               case 'i':
>                         ++n_excludes;
>                         excludes = realloc(excludes,
>                                            sizeof(*excludes) * n_excludes);
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/src/fssum.c b/src/fssum.c
index a243839a..b49ba59b 100644
--- a/src/fssum.c
+++ b/src/fssum.c
@@ -150,9 +150,9 @@  usage(void)
 	fprintf(stderr, "    -[UGOAMCDXES]: exclude respective field from calculation\n");
 	fprintf(stderr, "    -n          : reset all flags\n");
 	fprintf(stderr, "    -N          : set all flags\n");
-	fprintf(stderr, "    -x path     : exclude path when building checksum (multiple ok)\n");
+	fprintf(stderr, "    -i path     : ignore path when building checksum (multiple ok)\n");
 	fprintf(stderr, "    -h          : this help\n\n");
-	fprintf(stderr, "The default field mask is ugoamCdES. If the checksum/manifest is read from a\n");
+	fprintf(stderr, "The default field mask is ugoamCdxES. If the checksum/manifest is read from a\n");
 	fprintf(stderr, "file, the mask is taken from there and the values given on the command line\n");
 	fprintf(stderr, "are ignored.\n");
 	exit(-1);
@@ -713,7 +713,7 @@  main(int argc, char *argv[])
 	int plen;
 	int elen;
 	int n_flags = 0;
-	const char *allopts = "heEfuUgGoOaAmMcCdDsSnNw:r:vx:";
+	const char *allopts = "heEfuUgGoOaAmMcCdDxXsSnNw:r:vi:";
 
 	out_fp = stdout;
 	while ((c = getopt(argc, argv, allopts)) != EOF) {
@@ -735,6 +735,8 @@  main(int argc, char *argv[])
 		case 'C':
 		case 'd':
 		case 'D':
+		case 'x':
+		case 'X':
 		case 'e':
 		case 'E':
 		case 's':
@@ -768,7 +770,7 @@  main(int argc, char *argv[])
 				exit(-1);
 			}
 			break;
-		case 'x':
+		case 'i':
 			++n_excludes;
 			excludes = realloc(excludes,
 					   sizeof(*excludes) * n_excludes);