Skip to content

Commit e0273ec

Browse files
committed
add missing paragraphs from docs site.
1 parent 2cf2ef1 commit e0273ec

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/src/introduction.md

+20
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ script, this project serves as a demonstration of how to create a command-line
1414
tool in Rust with shell integration. Additionally, `mchdir` includes the `mct`
1515
command to create and enter directories in the system's temporary folder.
1616

17+
### Why?
18+
19+
I was getting tired of creating a new directory and then changing into it with
20+
two separate commands. I wanted a single command that could do both. I wrote a
21+
utility to do this decades ago on Windows, and I wanted the same functionality
22+
on Linux/macOS.
23+
24+
It's true that you can do the same thing with a simple shell function or alias!
25+
However, this project is a demonstration of how to create a command-line tool in
26+
Rust that provides shell integration. It will also probably get more features in
27+
the future.
28+
29+
### Why the need for shell integration too?
30+
31+
It is impossible to change the current working directory of the parent process
32+
from a child process (i.e., a command). This is because each process has its own
33+
working directory, and changes to the working directory are not propagated to
34+
the parent process. Hence, the mcd command cannot change the working directory
35+
of the shell that runs it without shell integration.
36+
1737
## Features
1838

1939
- Create a new directory and change into it with a single command.

0 commit comments

Comments
 (0)