-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mkdir
: make mkdir
public and document it
#5329
Conversation
@tertsdiepraam, opened the PR. It doesn't have much as of now, since I haven't made |
src/uu/mkdir/src/mkdir.rs
Outdated
/// | ||
/// ## Options | ||
/// | ||
/// * `recurisve` --- create parent directories for the given dirs, if they do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// * `recurisve` --- create parent directories for the given dirs, if they do | |
/// * `recursive` --- create parent directories for the given dirs, if they do |
Thanks for opening the PR! For context for others, we were talking here: #5321. A little recap: The question is: what should be exposed?
Multiple directories is usually not good for nushell, because they what control over the errors and make them pretty with miette. So, we prefer not to print errors but to return them (with With that out of the way, here are my thoughts. I think it makes sense to expose a function for making a single directory and let nushell do the looping for good errors. I also think the GNU fix at least doesn't hurt for nushell, so I see no reason to exclude it. So, in my opinion, the GNU fix is in the wrong spot: it should be in |
- Made the `mkdir` function public. Added documentation, describing the behavior and parameters - Moved the GNU dot-stripping behavior from `exec` to `mkdir`.
mkdir
: make exec
public and document itmkdir
: make mkdir
public and document it
Rewrote the commit:
Changed the PR name/description appropriately. |
I think the PR is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't merge this myself because I'm reviewing from the GH app, but this looks great!
/// ## Trailing dot | ||
/// | ||
/// To match the GNU behavior, a path with the last directory being a single dot | ||
/// (like `some/path/to/.`) is created (with the dot stripped). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great comment here!
Thanks :) |
mkdir
function public. Added documentation, describing the behavior and parametersexec
tomkdir
.