summaryrefslogtreecommitdiffstats
path: root/tools/src/h5copy
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-02-27 01:07:39 (GMT)
committerGitHub <noreply@github.com>2022-02-27 01:07:39 (GMT)
commite8b030363999befa548b94ac5c505d170540aebc (patch)
tree23e9d091c88e76bfe8ab842efa87cdda89e39974 /tools/src/h5copy
parent1c10010a316c0885cd71fad6c8d0067a0eb8f7f1 (diff)
downloadhdf5-e8b030363999befa548b94ac5c505d170540aebc.zip
hdf5-e8b030363999befa548b94ac5c505d170540aebc.tar.gz
hdf5-e8b030363999befa548b94ac5c505d170540aebc.tar.bz2
1.10 Fix tools incompatibility (#1449)
* fix tools incompatibility with get_option #1443 * Fix get_option function * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'tools/src/h5copy')
-rw-r--r--tools/src/h5copy/h5copy.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c
index 6f10fee..933e230 100644
--- a/tools/src/h5copy/h5copy.c
+++ b/tools/src/h5copy/h5copy.c
@@ -19,23 +19,23 @@
#define PROGRAMNAME "h5copy"
/* command-line options: short and long-named parameters */
-static const char * s_opts = "d:f:hi:o:ps:vVE";
-static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'},
- {"flag", require_arg, 'f'},
- {"help", no_arg, 'h'},
- {"input", require_arg, 'i'},
- {"output", require_arg, 'o'},
- {"parents", no_arg, 'p'},
- {"source", require_arg, 's'},
- {"verbose", no_arg, 'v'},
- {"version", no_arg, 'V'},
- {"enable-error-stack", no_arg, 'E'},
- {NULL, 0, '\0'}};
-char * fname_src = NULL;
-char * fname_dst = NULL;
-char * oname_src = NULL;
-char * oname_dst = NULL;
-char * str_flag = NULL;
+static const char * s_opts = "d:f:hi:o:ps:vVE";
+static struct long_options l_opts[] = {{"destination", require_arg, 'd'},
+ {"flag", require_arg, 'f'},
+ {"help", no_arg, 'h'},
+ {"input", require_arg, 'i'},
+ {"output", require_arg, 'o'},
+ {"parents", no_arg, 'p'},
+ {"source", require_arg, 's'},
+ {"verbose", no_arg, 'v'},
+ {"version", no_arg, 'V'},
+ {"enable-error-stack", no_arg, 'E'},
+ {NULL, 0, '\0'}};
+char * fname_src = NULL;
+char * fname_dst = NULL;
+char * oname_src = NULL;
+char * oname_dst = NULL;
+char * str_flag = NULL;
/*-------------------------------------------------------------------------
* Function: leave
@@ -242,19 +242,19 @@ main(int argc, char *argv[])
} /* end if */
/* parse command line options */
- while ((opt = H5_get_option(argc, (const char *const *)argv, s_opts, l_opts)) != EOF) {
+ while ((opt = get_option(argc, (const char *const *)argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'd':
- oname_dst = HDstrdup(H5_optarg);
+ oname_dst = HDstrdup(opt_arg);
break;
case 'f':
/* validate flag */
- if (parse_flag(H5_optarg, &flag) < 0) {
+ if (parse_flag(opt_arg, &flag) < 0) {
usage();
leave(EXIT_FAILURE);
}
- str_flag = HDstrdup(H5_optarg);
+ str_flag = HDstrdup(opt_arg);
break;
case 'h':
@@ -263,11 +263,11 @@ main(int argc, char *argv[])
break;
case 'i':
- fname_src = HDstrdup(H5_optarg);
+ fname_src = HDstrdup(opt_arg);
break;
case 'o':
- fname_dst = HDstrdup(H5_optarg);
+ fname_dst = HDstrdup(opt_arg);
break;
case 'p':
@@ -275,7 +275,7 @@ main(int argc, char *argv[])
break;
case 's':
- oname_src = HDstrdup(H5_optarg);
+ oname_src = HDstrdup(opt_arg);
break;
case 'V':