This is a request to add yadm completions to the repo.
These resemble the ones that are written for. The git one in your repo.
Yadm is a dotfiles manager that leverages `git` but uses your home
directory by default.
To see the tool go to <https://yadm.io/docs/overview>
Just using the completions I realized that:
```nu
# Create a new git repository
export extern "git init" [
--initial-branch(-b) # initial branch name
#should be
--initial-branch(-b): string # initial branch name
]
```
because initial branch takes a string, it not a boolean
Renames the `Changes to commands` section to just `Changes`. As such,
the breaking changes section is redundant since `Changes to commands`
already has a breaking changes subsection.
The linting flags `--warn`, `--deny`, `--allow` and `--forbid` have
`string` type rather than `bool`
Signed-off-by: OJarrisonn <j.h.m.t.v.10@gmail.com>
### What
- Rename main function to 'main' and add --env flag for environment
modification
- Fix region handling to properly check for null values
### Why
The aws/select-aws-profile script syntax is outdated
```shell
➜ nu
Error: nu::parser::named_as_module
× Can't export command named same as the module.
╭─[~/.config/nushell/nu_scripts/modules/aws/select-aws-profile.nu:12:12]
11 │ # select-aws-profile
12 │ export def select-aws-profile [] {
· ─────────┬────────
· ╰── can't export from module select-aws-profile
13 │ hide AWS_REGION;
╰────
help: Module select-aws-profile can't export command named the same as the module. Either change the module name, or export `main` command.
```
At some point this broke, just committing a fix I've had on my personal
computer for a while.
```
# This week in Nushell #261
## Nushell
Error: nu:🐚:name_not_found
× Name not found
╭─[/home/reilly/github/nu_scripts/make_release/this_week_in_nu_weekly.nu:36:48]
35 │
36 │ for user in ($site_json | group-by user_login | transpose user prs) {
· ─────┬────
· ╰── did you mean 'user.login'?
37 │ let user_name = $user.user
╰────
```
Remove custom completions for pixi.
Closes#937.
---
> [!NOTE]
> This is my first contribution to this project. I saw #937 and thought
it was a good first issue to help with 🙂
made scoop completions a bit more reliable by converting the PsObject
from powershell to json instead of parsing lines from the `scoop help`
output
doesn't take any longer since scoop run in powershell either way
Co-authored-by: unknown <67888720+kira-nyx@users.noreply.github.com>
Changes to `make.nu`:
* Adds in missing shapes and types noted further down in this PR by
@fdncred
* Adds colors for types - Mostly matching the corresponding shape, but
with any attribute (e.g., bold) removed
* Changed `int` and `float` values to be distinct. In most themes, the
colors should be complementary.
* Changes `bool: false` and `hints` colors - They were hardcoded to
`dark_grey` and wouldn't show up on some themes. Now uses a theme color
that should correspond to a theme-appropriate grey in most cases.
* Alphabetizes shapes and types so that Previews are also sorted
properly
* Eliminated spurious newline when sourcing theme (from printing OSC
codes for terminal colors)
* Renamed `3024` theme to `3024r` since module names can't be an `int`
Changes to `theme preview small`:
* Remove extra vertical spacing that was caused by different-sized row
column content
* Logically group elements - Types, Conditionally computed (closures)
types, Shapes, and other Structure (e.g., header, row_index, foreground,
etc.)
* Displays foreground/background on one line for clarity
Result is a much more compact, but also more readable, table.
Comparison:
<details><summary>Before</summary>
<p>
<img
src="https://github.com/user-attachments/assets/2673855d-d20d-4e14-8029-255138f2ecc9"
/>
</p>
</details>
<details><summary>After</summary>
<p>
<img
src="https://github.com/user-attachments/assets/c8824b7a-440d-4567-bd69-b2e1df358340"
/>
</p>
</details>
* Also refactored a lot of the code to be more maintainable - Moves the
rendering off to separate functions.
Changes to `preview_generate_screenshots.nu`:
* Accepts the method for generating screenshots as an argument
* Additional generation method using asciinema, agg (asciinema to
animated gif), and ffmpeg (to convert the animated gif to a single-image
PNG)
Additional Notes:
- Some Lemnos themes use color values that are the same (or nearly the
same) as the background in places. These are "broken" themes and always
have been as some elements will simply not be visible.
- There's a longstanding (I believe) bug that special-cased `record` for
the *key* rather than the *value*. I've fixed it so that the *key* is
now handled properly (same as other types), but I haven't implemented
any changes for color values that use a record (e.g., `{ fg: "#80a1a1",
attr: "b" }`) as this would make the table less compact. I'll look at
doing this for the longer form `preview theme` later.
- Closures other than for `string`, `bool`, `date`, and `filesize` are
currently only displayed as a summary. There aren't any themes currently
that this impacts, but if you create one manually, the display results
were pretty bad. This is primarily due to bad indentation from
`config.nu` (and/or defaults). A proper `nu-indent` would help fix this,
or maybe we could just remove all whitespace and display any closure as
a one-liner.
I probably won't regenerate screenshots until we figure out what to do
about the "monotone" type colors.
This is pretty much the least efficient reasonably simple way to
implement fibonacci in Nushell, and it's a good benchmark to profile our
custom command call performance, as this is the majority of the work
being done.
I think it may actually be good to add this and the other one to `cargo
bench` so we can track it over time, but it's also useful as a script so
it can easily be profiled.
Refactor docker custom completions to reorder `export extern`
declarations and make use of `export alias` to avoid repetition
Also fixes `docker run` needing a mandatory `network` argument which
doesn't exist
Also `print`s the theme rather than just returns it from `preview theme
small` - Otherwise we can't "script" the theme preview as part of
screenshotting (found while recording with Asciinema).
Just as a heads up, I haven't really tested this since a lot of it is
stuff I don't use or know how to set up without some reading up. I have
tested the nu_conda_2 change since I have a python project that I use
that for, and I could look into testing more of it if needed.
I've tried finding (naively using `/sys\W/`) all the usage of the old
plain `sys` calls and replacing them with alternates as appropriate,
which mostly has been to swap a `(sys).host.name` call into a
`$nu.os-info.name` one, since it'll be tad faster and more consistent
across platforms with naming (especially as the value comes from the
[rust stdlib](https://doc.rust-lang.org/std/env/consts/constant.OS.html)
and is very predictable).
Fixes#897
Four minor changes:
* As previously mentioned, updates `make.nu` to use `cell-path` rather
than `cellpath`
* Slight improvements on #905 (cc @amtoine) - The last theme converted
was the only one printed via `info`, but it didn't get removed from the
screen. Things moved so fast on my system that it looked like only one
theme was being converted, since that's the only message that was left
on the screen ;-). Now prints a "Done" message showing how many themes
were converted and how many failed.
* There was a previous update to `catppuccin-latte.nu` that was
apparently made directly to the theme, rather than the custom src.
Synced these up.
* Bumped `nupm.nuon`
i was mostly having fun there 😋
cc/ @NotTheDr01ds
## changes
- using some colors for the logging
- slight refactor of the main, i.e. i build a `table<name: string,
source: string>` of themes and then iterate over it and call `make-theme
$t.name $t.source`, thus getting rid of the twin pipelines
- i also build a `table<name: string, source: string>` of failing
themes, to show them at the end
## reviewing
i think the best to review this is
- go to `themes/`
- remove any copy of the `lemnos/` directory
- run `./src/make.nu` twice and see the output 😉
Lots of changes - Pretty every change needed to be made before updating
the preview screenshots, so they all end up in the same PR here:
* `preview-generate-screenshots.nu` now generates the previews and
screenshots all in one pass rather than requiring a separate file.
* Adds a new method for generating screenshots using PowerShell with no
third-party application required. Created new function for choosing the
method that is used to generate screenshots.
* Fixes background color on `nushell-dark` and `nushell-light` themes.
* Fixes bug where `cursor` setting (and perhaps one other) was getting
dropped from the preview table (`math ceil` was needed rather than `math
floor`)
* Fixes `cellpath` setting - Was changed to `cell-path` a while back but
never updated in the themes. All themes and their previews were
regenerated. Custom themes were manually adjusted.
* **Important:** I did not update `make.nu` to fix this (yet) since
@amtoine has a open PR against it that has not been merged yet. Easier
to either put that change in that PR or do it after that one has been
merged.
* Adds `mod.nu` in the root of the `themes` module. Moves some of the
previous script commands such as `preview_terminal`,
`preview_theme_small`, etc. over to the module. Makes for cleaner usage.
* Note: The completion functions in the scripts have been broken for
several months. I did not fix this at this point.
* `preview_theme_small` (and others) renamed to use spaces in command
name, so it is now `preview theme small`.
* Fixes bug of my own making that prevented several custom themes from
working.
* Refactors the "list to columns" code to use `group` (will need to be
updated to `chunks` in 0.96)
* Suppresses the indices column in the preview table
* Removes the column headers entirely since they don't serve any purpose
in this type of "columnar table"
I like to activate nu_msvs in my config by default and don't need a
message that tells me the command has been run when doing this. This
commit adds a --silent option so there's no message displayed when
running the command.
Added completions for most of the flags for `git grep`.
A few flags have been omitted for this PR due to Git expecting arguments
for those be passed without whitespaces. The arguments are optional, but
the flags would not work when passed arguments (see `--open-with-pager`
and `--color` flags in [this
commit](ffa9ceab73)
for how I tried to do it).
Ex.
`--open-with-pager(-O)` expects the optional argument to be passed as
either `--open-with-pager=<pager>` or `-O<pager>`. Including it in the
completions list as I had implemented it breaks the flag when using the
optional parameter.
Feedback appreciated for how to handle that. I'm still new to the Nu
language, so I might have missed something obvious that could fix that.
the other day, i was writing a script and wanted to pass a `list<int>`
to it which is not possible because there is no such things as _types_
for externals 🤔
i ended up writing an "arg parsing" command to help in that task and
thought it could be useful to people 😇
in this MR, i add `std-rfc parse-arg` in the `script-parsing.nu` module
and add associated tests which all pass.
i invite the reader to have a look at the docstring of `parse-arg` which
should contain a full example explaining the usage of this new command
😉
---------
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
at my job, i studied very quickly something that involved computing all
the ways one can build a positive integer from the addition of other
positive integers.
enters the `ways-to-add-up-to` command i've written and added to the
`math` module in this PR.
## example
`ways-to-add-up-to 4` will be `[[1, 1, 1, 1], [1, 1, 2], [1, 3], [2, 2],
[4]]]` because $4$
can be obtained as follows:
$$ 1 + 1 + 1 + 1 $$
$$ 1 + 1 + 2 = 1 + 2 + 1 = 2 + 1 + 1 $$
$$ 1 + 3 = 3 + 1 $$
$$ 2 + 2 $$
$$ 4 $$
> **Note**
> $1 + 1 + 2$ and $1 + 2 + 1$ are considered the same because addition
is _commutative_ and thus only `[1, 1, 2]` will be returned