If built without `trash_support`, nu should explicitly reject attempts to use `rm` with the `--trash` option, or with a config file which includes `rm_always_trash = true`.
As of 42fac72, there doesn't seem to be any guard in the `#[cfg(not(feature = "trash-support"))]` block of `filesystem_shell::rm`, leading to the behavior described in #3116, where builds without the trash-support feature will delete things permanently regardless of flags/config options.
This should close#3116
* Use ctx.configs in all config commands
* Remove all setting/accessing of vars.("config-path")
* Add tests
* Add comment
* Reload cfg on remove
* Hypocratic ws change
* Use history_path in hist_or_default
* Make clippy happy
* Fix rebase stuff
* Fix clippy lint
* Output error when ls into a file without permission
* added test to check fails when ls into prohibited dir
* fix lint
* trigger wasm build
* be able to remove fifos
* Update filesystem_shell.rs
* I thought windows had fifos
* fixed unix and windows conditional compilation
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* Output error when ls into a file without permission
* added test to check fails when ls into prohibited dir
* fix lint
* trigger wasm build
* Update filesystem_shell.rs
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* Revert "History, more test coverage improvements, and refactorings. (#3217)"
This reverts commit 8fc8fc89aa.
* Add tests
* Refactor .nu-env
* Change logic of Config write to logic of read()
* Fix reload always appends to old vars
* Fix reload always takes last_modified of global config
* Add reload_config in evaluation context
* Reload config after writing to it in cfg set / cfg set_into
* Add --no-history to cli options
* Use --no-history in tests
* Add comment about maybe_print_errors
* Get ctrl_exit var from context.global_config
* Use context.global_config in command "config"
* Add Readme in engine how env vars are now handled
* Update docs from autoenv command
* Move history_path from engine to nu_data
* Move load history out of if
* No let before return
* Add import for indexmap
* enable ability to see all aliases, pull in code from scope branch
* add in the alias tests
* add back in my changes to variables.rs after merging in andrasios changes from PR #3217
Improvements overall to Nu. Also among the changes here, we can also be more confident towards incorporating `3041`. End to end tests for checking envs properly exported to externals is not added here (since it's in the other PR)
A few things added in this PR (probably forgetting some too)
* no writes happen to history during test runs.
* environment syncing end to end coverage added.
* clean up / refactorings few areas.
* testing API for finer control (can write tests passing more than one pipeline)
* can pass environment variables in tests that nu will inherit when running.
* No longer needed.
* no longer under a module. No need to use super.
* add ability to cd to ~/blah. tested on windows.
* added dirs_next
* put change behind feature for linux-minimal/wasm
* clippy
* holy crap minimal, i'm about done with you!
* Playground infraestructure (tests, etc) additions.
A few things to note:
* Nu can be started with a custom configuration file (`nu --config-file /path/to/sample_config.toml`). Useful for mocking the configuration on test runs.
* When given a custom configuration file Nu will save any changes to the file supplied appropiately.
* The `$nu.config-path` variable either shows the default configuration file (or the custom one, if given)
* We can now run end to end tests with finer grained control (currently, since this is baseline work, standard out) This will allow to check things like exit status, assert the contents with a format, etc)
* Remove (for another PR)
* Move run_script to engine
* Add which dep and feature to engine
* Change unwrap to expect
* Add wasm specification
* Remove which from default, add specification correctly
* Add nu-platform-specifics
* Move is_external_cmd to platform_specifics
* Add is_external_cmd to host and use it instead of nu_platform directly
* Clean up if else logic in is_external_cmd
* Bump nu-platform-specifics version
* Pass context to print_err
* Commit cargo.lock
* Move print functions to own module inside nu-engine
* Hypocratic change to run windows-nightly again
* Add import for Ordering
* Move printing of error to host
* Move platform specific which functionality to basic host
* Allow no use of cmd_name
* Fix windows compile issue
For now the trash doesn't work because the trash-support flag isn't enabled in nu-engine
crate, so make it work by adding this flag.
Signed-off-by: Tw <wei.tan@intel.com>
Co-authored-by: Tw <wei.tan@intel.com>
* Split help message into brief and full help
Demonstrate on ansi command
Brief help is printed when running `help commands` so it doesn't clutter
the table. Full help is printed when normal help message is requested
(e.g., `help ansi`, `ansi --help`, etc.).
* Split long command descriptions
Some are not split, just edited to be shorter.
* Capitalize the usage of all commands
* Make sure every usage ends with dot
* Fix random typo
* fix case where parent_name was {nu, term} and possibly others in the future by doing an extra test first to see if if the *parent_name key actually exists in cmap
* update with help generate_docs testing