Skip to content

Conversation

@bacali95
Copy link
Collaborator

@bacali95 bacali95 commented Oct 30, 2021

Closes #69

@bacali95 bacali95 self-assigned this Oct 30, 2021
@bacali95 bacali95 requested a review from thevpc October 30, 2021 13:17
@thevpc
Copy link
Owner

thevpc commented Oct 30, 2021

Using CoreNutsUtils.isIncludesHelpOption is a bad idea, This is why it was commented.
Take the example where "--xml" is part of the options. This call will ignore the option.
Perhaps one can do like in DefaultNutsSettingsInternalExecutable but am not sure it works properly (the version i have now is broken)

@bacali95
Copy link
Collaborator Author

I think that --xml argument and all standard options will not be ignored in this case because it will be already parsed while creating NutsBootWorkspace, so I think usinf that helper is safe.

public NutsBootWorkspace(NutsBootTerminal bootTerminal,String... args) {
    LOG=new PrivateNutsLog(bootTerminal);
    this.options=new PrivateBootWorkspaceOptions(LOG)
            .parseArguments(args)
            .setBootTerminal(bootTerminal)
            .build();
    LOG.setOptions(this.options);
    newInstanceRequirements = 0;
}

@bacali95 bacali95 force-pushed the fix/command-help-argument branch from c55a917 to df8fc6f Compare October 30, 2021 18:07
@thevpc
Copy link
Owner

thevpc commented Oct 30, 2021

--xml can appear before the command (parsed at boot) or after the command (parsed by the command)

nuts --xml ls --json

in this example, ls is executed in json format and not --xml

Let me add another example:

nuts --xml settings --json --help

@bacali95
Copy link
Collaborator Author

I didn't where the issue here, do we need to take the last format (--json or --xml...) option?

@thevpc
Copy link
Owner

thevpc commented Nov 1, 2021

Do not bother yourself with this limit case. I will accept the changes anyway.

@thevpc thevpc merged commit e155fbc into master Nov 1, 2021
@thevpc thevpc deleted the fix/command-help-argument branch November 1, 2021 15:39
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.

<command> --help is no more working

3 participants