Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dfilemaker: exit on unrecognized option and remove duplicate longopts struct #610

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

ofaaland
Copy link
Collaborator

(1) A duplicate longopts struct introduced during a rebase, when creating a PR to add

        commit 1187ecf27e5ffb76b5a2ee0334d3b0925c0b32ff
        Author: Olaf Faaland <faaland1@llnl.gov>
        Date:   Thu Nov 21 16:19:03 2024 -0800

            dfilemaker: define options near print_usage()

            Define the strings passed to getopt_long, short_options and
            long_options, next to each other and next to print_usage() so
            it's easier to ensure they stay synchronized with each other.

            Signed-off-by: Olaf Faaland <faaland1@llnl.gov>

(2) In addition, when adding support for "--verbose", some parts of the code
were changed from "version" to "verbose", but some were missed.

(3) If getopt_long() encounters an unknown option, print usage information
and stop execution.

Continuing to process options and create files, after encountering an
unknown option, will create a file tree different than the one the user
intended. For example, if the user mistypes the option for file size,
e.g.
"--sizeRRR=2MB-10000GB"
instead of
"--size=2MB-10000GB"

proceeding would mean we use the default file size range when
constructing the tree instead of the one the user intended.

If getopt_long() encounters an unknown option, print usage information
and stop execution.

Continuing to process options and create files, after encountering an
unknown option, will create a file tree different than the one the user
intended.  For example, if the user mistypes the option for file size,
e.g.
	"--sizeRRR=2MB-10000GB"
instead of
	 "--size=2MB-10000GB"

proceeding would mean we use the default file size range when
constructing the tree instead of the one the user intended.

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
A duplicate longopts struct introduced during a rebase, when
creating a PR to add

	commit 1187ecf
	Author: Olaf Faaland <faaland1@llnl.gov>
	Date:   Thu Nov 21 16:19:03 2024 -0800

	    dfilemaker: define options near print_usage()

	    Define the strings passed to getopt_long, short_options and
	    long_options, next to each other and next to print_usage() so
	    it's easier to ensure they stay synchronized with each other.

	    Signed-off-by: Olaf Faaland <faaland1@llnl.gov>

In addition, when adding support for "--verbose", some parts of the code
were changed from "version" to "verbose", but some were missed.

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
@ofaaland ofaaland self-assigned this Nov 26, 2024
@ofaaland ofaaland requested a review from carbonneau1 November 26, 2024 01:21
@ofaaland ofaaland merged commit b65c188 into hpc:main Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants