* Output error when ls into a file without permission
* math sqrt
* added test to check fails when ls into prohibited dir
* fix lint
* math sqrt with tests and doc
* trigger wasm build
* Update filesystem_shell.rs
* always forgetting the linting
* fix clippy complaining
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* update docs to refer to length instead of count
* rename count to length
* change all occurrences of 'count' to 'length' in tests
* format length command
* Add possibility to declare optional parameters and switch flags
With this commit applied it is now possible to specify optional parameters and flags
as switches. This PR **only** makes guarantees about **parsing** optional flags and
switches correctly. This PR **does not guarantee flawless functionality** of
optional parameters / switches within scripts.
functionality within scripts. Example:
test.nu
```shell
def my_command [
opt_param?
opt_param2?: int
--switch
] {echo hi nushell}
```
```shell
> source test.nu
> my_command -h
───┬─────────
0 │ hi
1 │ nushell
───┴─────────
Usage:
> my_command <mandatory_param> (opt_param) (opt_param2) {flags}
Parameters:
<mandatory_param>
(opt_param)
(opt_param2)
Flags:
-h, --help: Display this help message
--switch
--opt_flag <any>
```
* Update def docs
* Display aliases and custom commands in which; Fix#2810
Example output of nu after the commit is applied:
```shell
/home/leo/repos/nushell(feature/which_inspect_alias)> def docker-ps [] { docker ps --format '{{json .}}' | from json -o }
/home/leo/repos/nushell(feature/which_inspect_alias)> which docker-ps
───┬───────────┬────────────────────────┬─────────
# │ arg │ path │ builtin
───┼───────────┼────────────────────────┼─────────
0 │ docker-ps │ nushell custom command │ No
───┴───────────┴────────────────────────┴─────────
/home/leo/repos/nushell(feature/which_inspect_alias)> alias d = gid pd
/home/leo/repos/nushell(feature/which_inspect_alias)> which d
───┬─────┬───────────────┬─────────
# │ arg │ path │ builtin
───┼─────┼───────────────┼─────────
0 │ d │ nushell alias │ No
───┴─────┴───────────────┴─────────
```
* Update documentation
* Begin allowing comments and multiline scripts.
* clippy
* Finish moving to groups. Test pass
* Keep going
* WIP
* WIP
* BROKEN WIP
* WIP
* WIP
* Fix more tests
* WIP: alias starts working
* Broken WIP
* Broken WIP
* Variables begin to work
* captures start working
* A little better but needs fixed scope
* Shorthand env setting
* Update main merge
* Broken WIP
* WIP
* custom command parsing
* Custom commands start working
* Fix coloring and parsing of block
* Almost there
* Add some tests
* Add more param types
* Bump version
* Fix benchmark
* Fix stuff
* added math round
* added math floor
* added math ceil
* added math.md examples
* moved the detection of nonnumerical values in ceil/floor/round
* math round now works on streams
* math floor now works on streams
* math ceil now works on streams
* First draft for adding a `pretty` flag to `to md`
* rustfmt
* Fix Clippy warnings
* rustfmt
* Using Clippy suggestion broken code, reverting and putting in a statement to ignore clippy warning
* Add test for `to md -p`
* Add deserialization of Primitive::Duration; Fixes#2373
* Implement Sleep command
* Add comment saying you should name your rest field "rest"
* Fix typo
* Add documentation for sleep command
* Rename `calc` to `math eval` and allow it to optionally take the expression as an argument
* Moved calc tests to math eval
Also added 2 tests and changed 1 test
* Move calc docs to math eval
* Very rough idea
* Remove colour codes
* Work on command for generating docs
* Quick comment
* Use nested collapsible markdown
* Refine documentation command
* Clippy and rename docs
* This layout probably seems best
Also moved some code to documentation.rs to avoid making help.rs massive
* Delete summaries.md
* Add usage strings
* Remove static annotations
* get_documentation produces value
Which will be used like
'help generate_docs | save "something"'
The resulting yaml can be passed to a script for generating HTML/MD files in the website
* Fix subcommands
* DRY code
* Address clippy:
* Fix links
* Clippy lints
* Move documentation to more central location
* [ADD] Add draft documentation for autoview
* [ADD] Add draft documentation for pwd
* [ADD] Add draft documentation for touch
* [MOD] Improve description and add examples
Add the use of `textview` and `binaryview`.
Add examples for single value, source file and binary file.
* Add bool subcommand to random
* Fix function name copy paste error
* Fix issue 2062: allow deserialization of a decimal
* Add bias flag to `random bool`
* uniq: Add counting option (WIP!)
Usage:
fetch https://raw.githubusercontent.com/timbray/topfew/master/test/data/access-1k | lines | wrap item | uniq | sort-by count | last 10
* uniq: Add first test
* uniq: Re-enable the non-counting variant.
* uniq: Also handle primitive lines.
* uniq: Update documentation
* uniq: Final comment about error handling. Let's get some feedback
* uniq: Address review comments.
Not happy with the way I create a TypeError. There must be a cleaner
way. Anyway, good for shipping.
* uniq: Use Labeled_error as suggested by jturner in chat.
* uniq: Return error directly.
Co-authored-by: Christoph Siedentop <christoph@siedentop.name>
* Add math median example and unit tests
* Update output of other all math ls command examples to keep consistent with math median output
* Fix output of math max example
* Update output of other math commands using pwd examples to keep data consistent
* Move sum tests into math directory
* Move sum documentation over to math documentation
One sum example already existed in the math examples and a few of the others were outdated and didn't work, so I only moved one over, and updated their output
* Remove no-longer-in-use mod statement
* Add support to allow the week day start in cal to be configurable
* Fix variable name
* Use a flag instead of a configuration setting for specifying the starting day of the week
* Add 'every' command
* Add --skip option to 'every' command
This option skips instead of selects every nth row
* Fix descriptions for 'every' command
* Add docummentation for 'every' command
* Check actual filenames in 'every' command tests
* Adding math docs
* Add some comments to calculate
* Remove redudant message
Message already shows up in subcommands list
* Added not working example
Accidentantly
* Remove table
* Add `rm_always_trash` option to config
* Add `--permanent` flag to `rm`
* `rm`: error if both `-t` and `-p` are present
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* added examples and explanation to trim
inserted examples (taken from parse in cookbook) for lists and tables using trim
* Move `to-json` to `to json`
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* Adding iniitial draft for the addition of the count column on the histogram command
* Update histogram documentation
* Add count column test to histogram command
* Fix error in histogram documentation