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

move all flags to subcommand #1081

Closed
yajo opened this issue Apr 7, 2023 · 0 comments · Fixed by #1143
Closed

move all flags to subcommand #1081

yajo opened this issue Apr 7, 2023 · 0 comments · Fixed by #1143
Milestone

Comments

@yajo
Copy link
Member

yajo commented Apr 7, 2023

Is your feature request related to a problem? Please describe.

Subcommand flags are divided between common and specific. This causes confusion and makes adding new subcommands hard.

Valid example:

copier -r HEAD update --conflict inline 

Invalid:

copier update -r HEAD --conflict inline

Describe the solution you'd like

All flags should exist in the subcommand.

The shortcut syntaxes should just redirect to the underlying subcommand automatically.

Describe alternatives you've considered

Additional context

This is breaking change.

Relevant discussion: #1031 (comment)

@yajo yajo added this to the Later milestone Apr 7, 2023
@yajo yajo modified the milestones: Later, Soon Apr 7, 2023
yajo added a commit that referenced this issue May 17, 2023
This new command allows to reapply a template, keeping old answers but discarding subproject evolution.

It is useful when there are bugs replaying an old version of the template, or when the subproject has drifted too much from the template and you need to reset it.

BREAKING CHANGE: All CLI calls to Copier must now include the subcommand as the 1st argument. For example, `copier` must become now `copier update`; also `copier ./tpl ./dst` must become `copier copy ./tpl ./dst`.

BREAKING CHANGE: All flags must go after the subcommand now. For example, `copier -r HEAD update ./dst` must now become `copier update -r HEAD ./dst` or `copier update ./dst -r HEAD`.

BREAKING CHANGE: Automatic mode removed. Since now subcommands are required, the automatic mode is removed.

BREAKING CHANGE: Deprecated `copier.copy` function is removed. Use `copier.run_copy`, `copier.run_update` or `copier.run_recopy` explicitly as needed.

Fix #1081
Close #1082
@yajo yajo mentioned this issue May 17, 2023
@yajo yajo closed this as completed in 6996b9c May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant