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

sync: improve error messages for invalid update options #679

Merged
merged 2 commits into from
Oct 27, 2022

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Oct 18, 2022

Changes:

  • Add tests for the fix in d5f5485.

  • Try to improve error wordings, and try to reorder list items by likelihood of what the user wanted.

Follow-up from #674 (comment)


Before this commit

$ configlet sync -o -uy --tests
Error: '-y, --yes' was provided to non-interactively update, but the tests updating mode is still 'choose'.
You can either:
- remove '-y, --yes', and update by confirming prompts
- or narrow the syncing scope via some combination of --docs, --filepaths, and --metadata
- or add '--tests include' or '--tests exclude' to non-interactively include/exclude missing tests
If no syncing scope option is provided, configlet uses the full syncing scope.
If no --tests value is provided, configlet uses the 'choose' mode.

configlet 4.0.0-beta.6
The official tool for managing Exercism language track repositories.

Usage:
  configlet [global-options] <command> [command-options]
[...]
$ configlet sync -o -u --docs < /dev/null
Error: Configlet was used in a non-interactive context, and the --update option was passed without the --yes option
You can either:
- keep using configlet non-interactively, and remove the --update option so that no destructive changes are performed
- keep using configlet non-interactively, and add the --yes option to perform destructive changes
- use configlet in an interactive terminal

configlet 4.0.0-beta.6
The official tool for managing Exercism language track repositories.

Usage:
  configlet [global-options] <command> [command-options]
[...]

With this commit

$ configlet sync -o -uy --tests
Error: '-y, --yes' was provided to non-interactively update, but tests are in
the syncing scope and the tests updating mode is 'choose'.

You can either:
- use '--tests include' or '--tests exclude' to non-interactively include/exclude
  missing tests
- or narrow the syncing scope via some combination of '--docs', '--filepaths', and
  '--metadata' (removing '--tests' if it was passed)
- or remove '-y, --yes', and update by answering prompts

If no syncing scope option is provided, configlet uses the full syncing scope.
If '--tests' is provided without an argument, configlet uses the 'choose' mode.

----------------------

configlet 4.0.0-beta.6
The official tool for managing Exercism language track repositories.

Usage:
  configlet [global-options] <command> [command-options]
[...]
$ configlet sync -o -u --docs < /dev/null
Error: configlet ran in a non-interactive context, but interaction was required because
'--update' was passed without '--yes', and at least one of docs, filepaths, and
metadata were in the syncing scope.

You can either:
- keep using configlet non-interactively, and add the '--yes' option to perform
  changes without confirmation
- or keep using configlet non-interactively, and remove the '--update' option so
  that configlet performs no changes
- or run the same command in an interactive terminal, to update by answering
  prompts

----------------------

configlet 4.0.0-beta.6
The official tool for managing Exercism language track repositories.

Usage:
  configlet [global-options] <command> [command-options]
[...]

Expand slightly, and try to reorder list items by likelihood of what the
user wanted.
@ee7 ee7 merged commit 9b75bd7 into exercism:main Oct 27, 2022
@ee7 ee7 deleted the sync-improve-update-error-messages branch October 27, 2022 17:07
@ee7 ee7 changed the title sync: improve update error messages sync: improve error messages for invalid update options Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants