Skip to content

mkdir: expose main functionality for nushell #5321

Closed

Description

@kaathewisegit

mkdir's exec function should be exported, as per #5088.

Activity

  1. changed the title [-]`mkdir:`[/-] [+]`mkdir`: expose main functionality for nushel[/+] on Sep 25, 2023
  2. changed the title [-]`mkdir`: expose main functionality for nushel[/-] [+]`mkdir`: expose main functionality for nushell[/+] on Sep 25, 2023
  3. kaathewisegit commented on Sep 25, 2023

    @kaathewisegit
    ContributorAuthor

    @tertsdiepraam, made an issue.

    From what I understand, exporting exec should be enough. The behavior is controlled by primitive types, so this part is easy. ValuesRef from clap poses a question, however. Could it be turned into a vector with .copied().collect() inside main?

  4. tertsdiepraam commented on Sep 25, 2023

    @tertsdiepraam
    Collaborator

    Yep we can't expose ValuesRef. Nushell wouldn't like to depend on clap if possible (we need to find a solution for other utils too). However, we can just make it accept impl IntoIterator<OsString> instead.

  5. kaathewisegit commented on Sep 27, 2023

    @kaathewisegit
    ContributorAuthor

    I am doing a PR right now, and I wonder, if it makes more sense to expose mkdir function instead of exec. It doesn't have the dot stripping GNU idiosyncrasy and it won't need a signature refactor. Because the signature I came up with looks like this:

    pub fn exec<'a, I>(dirs: I, recursive: bool, mode: u32, verbose: bool) -> UResult<()>
    where
        I: IntoIterator<Item = &'a OsString>,

    I'll also ask the Nushell team about it.

  6. tertsdiepraam commented on Sep 27, 2023

    @tertsdiepraam
    Collaborator

    Interesting! Please make a PR. It's much easier to discuss if there's code we can reference.

  7. kaathewisegit commented on Oct 21, 2023

    @kaathewisegit
    ContributorAuthor

    Closing this issue, as the PR got merged.

  8. tertsdiepraam commented on Oct 21, 2023

    @tertsdiepraam
    Collaborator

    Excellent, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions