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

fix public boolean switches in the standard library #10477

Merged
merged 1 commit into from Sep 23, 2023

Conversation

amtoine
Copy link
Member

@amtoine amtoine commented Sep 23, 2023

related to

Description

this PR will fix the public API of the standard library by removing the type annotations from public boolean switches.

  1. the signature before
clip [--silent: bool, --no-notify: bool, --no-strip: bool, --expand (-e): bool, --codepage (-c): int]
  1. the signature after
clip [--silent, --no-notify, --no-strip, --expand (-e), --codepage (-c): int]

User-Facing Changes

before

> "foo" | clip
Error: nu::shell::cant_convert

  × Can't convert to bool.
     ╭─[NU_STDLIB_VIRTUAL_DIR/std/mod.nu:148:1]
 148 │         $in
 149 │         | if $expand { table --expand } else { table }
     ·              ───┬───
     ·                 ╰── can't convert nothing to bool
 150          | into string
     ╰────

after

> "foo" | clip
foo
saved to clipboard

Tests + Formatting

After Submitting

@amtoine amtoine added the std-library Defining and improving the standard library written in nu and the core Rust ccommands label Sep 23, 2023
@fdncred fdncred merged commit b6d31e0 into nushell:main Sep 23, 2023
19 checks passed
@fdncred
Copy link
Collaborator

fdncred commented Sep 23, 2023

Thanks

@amtoine amtoine deleted the fix-boolean-switches branch September 24, 2023 08:20
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
related to
- nushell#10456

# Description
this PR will fix the public API of the standard library by removing the
type annotations from public boolean switches.

1. the signature before
```nushell
clip [--silent: bool, --no-notify: bool, --no-strip: bool, --expand (-e): bool, --codepage (-c): int]
```
2. the signature after
```nushell
clip [--silent, --no-notify, --no-strip, --expand (-e), --codepage (-c): int]
```

# User-Facing Changes
### before
```nushell
> "foo" | clip
Error: nu::shell::cant_convert

  × Can't convert to bool.
     ╭─[NU_STDLIB_VIRTUAL_DIR/std/mod.nu:148:1]
 148 │         $in
 149 │         | if $expand { table --expand } else { table }
     ·              ───┬───
     ·                 ╰── can't convert nothing to bool
 150 │         | into string
     ╰────
```

### after
```nushell
> "foo" | clip
foo
saved to clipboard
```

# Tests + Formatting

# After Submitting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
std-library Defining and improving the standard library written in nu and the core Rust ccommands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants