forked from extern/nushell
Update implementing_a_command.md (#3848)
+ nu-command/src/command.rs has been modified to nu-command/src/mod.rs in nowable version
This commit is contained in:
parent
e4c282f0a6
commit
ea42a84a4a
@ -86,7 +86,7 @@ pub struct Command;
|
||||
|
||||
Before registering it to the context you need to make it available by declaring the module and re-export it in `crates/nu-command/src/commands.rs`. The commands we write are modules already (`take_two.rs` is the `take_two` module). In case you are not familiar with rust modules [read this refresher](https://doc.rust-lang.org/book/ch07-02-defining-modules-to-control-scope-and-privacy.html). Let's go ahead and declare it and then re-export the command's `Command` struct as `TakeTwo`, like so:
|
||||
|
||||
_nu-command/src/commands.rs_
|
||||
_nu-command/src/mod.rs_
|
||||
```rust
|
||||
# ...
|
||||
pub(crate) mod take_two;
|
||||
@ -267,4 +267,4 @@ Not bad. We created first a list of int values and took two of them. Let's creat
|
||||
───┴──────────
|
||||
```
|
||||
|
||||
The command is ready.
|
||||
The command is ready.
|
||||
|
Loading…
Reference in New Issue
Block a user