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

Deprecate to xml --pretty {int} in favor of --indent {int} #10660

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

Hofer-Julian
Copy link
Contributor

@Hofer-Julian Hofer-Julian commented Oct 9, 2023

Fixes #10644

the deprecation errors

  • using --pretty alone` will run the command and give a warning
> {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4
Error:   × Deprecated option
   ╭─[entry #7:1:1]
 1  {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4
   ·                                                             ───┬──
   ·                                                                ╰── `to xml --pretty {int}` is deprecated and will be removed in 0.87.
   ╰────
  help: Please use `--indent {int}` instead.


<note>
    <remember>Event</remember>
</note>
  • using --pretty and --indent will give the deprecation warning and throw an error
> {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4 --indent 4
Error:   × Deprecated option
   ╭─[entry #9:1:1]
 1  {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4 --indent 4
   ·                                                             ───┬──
   ·                                                                ╰── `to xml --pretty {int}` is deprecated and will be removed in 0.87.
   ╰────
  help: Please use `--indent {int}` instead.


Error: nu::shell::incompatible_parameters

  × Incompatible parameters.
   ╭─[entry #9:1:1]
 1  {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4 --indent 4
   ·                                                                                       
   ·                                                                                       ╰── and --indent
   ·                                                                             ╰── Cannot pass --pretty
   ╰────

Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice @Hofer-Julian, that was exactly what i was talking about in the issue 🙏 👌

@amtoine
Copy link
Member

amtoine commented Oct 9, 2023

i've just updated the PR description with two examples and let's land this 😉

@amtoine amtoine merged commit 9f14479 into nushell:main Oct 9, 2023
19 checks passed
@amtoine
Copy link
Member

amtoine commented Oct 9, 2023

@Hofer-Julian
would you mind opening a removal PR right now as a DRAFT so that it's ready for next release? 😇

@Hofer-Julian Hofer-Julian deleted the deprecate-to-xml-pretty branch October 9, 2023 17:06
@Hofer-Julian
Copy link
Contributor Author

Sure

#10668

@amtoine amtoine mentioned this pull request Oct 14, 2023
amtoine pushed a commit that referenced this pull request Oct 19, 2023
gaetschwartz pushed a commit to gaetschwartz/nushell that referenced this pull request Oct 20, 2023
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
…ll#10660)

Fixes nushell#10644

## the deprecation errors
- using `--pretty` alone` will run the command and give a warning
```nushell
> {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4
Error:   × Deprecated option
   ╭─[entry nushell#7:1:1]
 1 │ {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4
   ·                                                             ───┬──
   ·                                                                ╰── `to xml --pretty {int}` is deprecated and will be removed in 0.87.
   ╰────
  help: Please use `--indent {int}` instead.


<note>
    <remember>Event</remember>
</note>
```
- using `--pretty` and `--indent` will give the deprecation warning and
throw an error
```nushell
> {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4 --indent 4
Error:   × Deprecated option
   ╭─[entry nushell#9:1:1]
 1 │ {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4 --indent 4
   ·                                                             ───┬──
   ·                                                                ╰── `to xml --pretty {int}` is deprecated and will be removed in 0.87.
   ╰────
  help: Please use `--indent {int}` instead.


Error: nu:🐚:incompatible_parameters

  × Incompatible parameters.
   ╭─[entry nushell#9:1:1]
 1 │ {tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 4 --indent 4
   ·                                                                             ┬          ┬
   ·                                                                             │          ╰── and --indent
   ·                                                                             ╰── Cannot pass --pretty
   ╰────
```
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
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.

Inconsistent flags for format commands
2 participants