mirror of
https://github.com/nushell/nushell.git
synced 2025-01-13 09:48:30 +01:00
6f9b9914cf
# Description The `members` parameter of `use` is specified as type `any`, but it's really a string or list of strings or `*`. So add some examples that mention what you can specify for `members`. Also mention `help modules` and `help std`, since you probably want to use the standard library or another defined modules. Sidenote: I tried to run the examples for `use` as tests like is done for the other commands. That panics with `missing module command`. I assume this is known. # User-Facing Changes `help use` now looks like this: ```nushell Use definitions from a module, making them available in your shell. See `help std` for the standard library module. See `help modules` to list all available modules. This command is a parser keyword. For details, check: https://www.nushell.sh/book/thinking_in_nu.html Usage: > use <module> (members) Flags: -h, --help - Display the help message for this command Parameters: module <string>: Module or module file (optional) members <any>: Which members of the module to import Examples: Define a custom command in a module and call it > module spam { export def foo [] { "foo" } }; use spam foo; foo foo Define a custom command that participates in the environment in a module and call it > module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR BAZ Use a plain module name to import its definitions qualified by the module name > module spam { export def foo [] { "foo" }; export def bar [] { "bar" } }; use spam; (spam foo) + (spam bar) foobar Specify * to use all definitions in a module > module spam { export def foo [] { "foo" }; export def bar [] { "bar" } }; use spam *; (foo) + (bar) foobar To use commands with spaces, like subcommands, surround them with quotes > module spam { export def 'foo bar' [] { "baz" } }; use spam 'foo bar'; foo bar baz To use multiple definitions from a module, wrap them in a list > module spam { export def foo [] { "foo" }; export def 'foo bar' [] { "baz" } }; use spam ['foo', 'foo bar']; (foo) + (foo bar) foobaz ``` |
||
---|---|---|
.. | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu-cli | ||
nu-cmd-lang | ||
nu-color-config | ||
nu-command | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-std | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
README.md |
Nushell core libraries and plugins
These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.
Foundational libraries are split into two kinds of crates:
- Core crates - those crates that work together to build the Nushell language engine
- Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.
Plugins are likewise also split into two types:
- Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
- Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.