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

Create constants for cli argument names #115

Closed
jstuczyn opened this issue Feb 5, 2020 · 1 comment
Closed

Create constants for cli argument names #115

jstuczyn opened this issue Feb 5, 2020 · 1 comment

Comments

@jstuczyn
Copy link
Contributor

jstuczyn commented Feb 5, 2020

While this is already applicable to current develop branch, it is mostly concerning #config_files branch. If new arguments were to be added, it's relatively easy to accidentally make a typo in one but not the other.
So say the following:

        .arg(
            Arg::with_name("host")
                .long("host")
                .help("The custom host on which the mixnode will be running")
                .takes_value(true)
                .required(true),
        )

...

    if let Some(host) = matches.value_of("host") {
        config = config.with_listening_host(host);
    }

should be change to something like

       const HOST_ARGUMENT_NAME: &'static str: "host";

        ...

 
        .arg(
            Arg::with_name("host")
                .long(HOST_ARGUMENT_NAME)
                .help("The custom host on which the mixnode will be running")
                .takes_value(true)
                .required(true),
        )

...

    if let Some(host) = matches.value_of(HOST_ARGUMENT_NAME) {
        config = config.with_listening_host(host);
    }
@jstuczyn jstuczyn added this to the 0.6.0 milestone Feb 5, 2020
@futurechimp futurechimp removed this from the 0.6.0 milestone Apr 7, 2020
@tommyv1987
Copy link
Contributor

Closing issue, archiving for future planning session - the issues / tasks have moved to a new project board, so we can evaluate shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

No branches or pull requests

3 participants