Skip to content
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

There seems not to be any document about path as a type. #1044

Open
otakutyrant opened this issue Sep 4, 2023 · 2 comments
Open

There seems not to be any document about path as a type. #1044

otakutyrant opened this issue Sep 4, 2023 · 2 comments

Comments

@otakutyrant
Copy link

Altough it is confirmed that path is a type and a command simutaneously. Types of Data does not include path, and path only regards itself as a command.

@fdncred
Copy link
Collaborator

fdncred commented Sep 4, 2023

Technically path is not a type. You can see the nushell types here:

https://github.com/fdncred/nushell/blob/main/crates/nu-protocol/src/ty.rs#L9-L37

It is a SyntaxShape as you can see here:

https://github.com/fdncred/nushell/blob/main/crates/nu-protocol/src/syntax_shape.rs#L7-L119

and here:

https://github.com/fdncred/nushell/blob/main/crates/nu-parser/src/parser.rs#L2685-L2765

I'm not sure all of these can be used as "shapes" in custom commands. I thought there was another list for custom commands, but I can't seem to find it now. Maybe someone else has an idea.

@otakutyrant
Copy link
Author

The real X question is that I want to define the shape of an argument of an extern command stow as directories only so that I can complete the command with directories names only. So I want to check the document of the "type" path to see whether I can find the appropriate type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants