feat(clap): return an error if enterprise arg cluster-id is used #26968
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It has been a common mistake to run core's binary thinking it is enterprise 3. This seems to error first on the --cluster-id arg which is present in enterprise 3 but not core. Clap gives an "unexpected argument" error which is confusing as the user thought they were running enterprise.
This commit updates Core to look for this argument and always return an error explaing that this is core and an enterprise argument was used. This gives clear direction for the problem and how to fix it.
--cluster-idserve parameter #26967The error looks like this: which is clear in the problem and how to address it (some might say verbose). Clap's errors are already multiline so i didn't fret much about adding more newlines.
Note
If you don't like my (ab)use of clap; see my comment in the ticket for an alternative which i didn't like as much. Either way works.