You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently auto-completion is very simple, it expects the first word to be a command and next words to be files. This is already wrong, as some commands are made of multiple words (sort reverse) and what's more some commands do not accept files as parameters to begin with, so we do not need auto-completion for them. And other commands accept only folders, so autocompleting files should be avoided.
I propose to either add a simple specification, which every command should implement, to aid with autocompletion.
Something akin to:
structCommand{spec:Specifiaction
...
}structSpecification{params:Vec<(&'static str,Specification)>,// to cover `sort reverse`, `cd ..` and `cd -`.file_ty:Option<(FileTy,usize)>,// usize to show how many files the command might accept}enumFileTy{Any,Directories,FIles,}
This specification is in no way complete, but it covers the most general cases, which I think should suffice for now.
Or make Command implement autocompleting interface through traits. (Possibly with a default implementation).
After we decide what to do (and whether to do anything at all), I will be willing to implement it.
The text was updated successfully, but these errors were encountered:
Currently auto-completion is very simple, it expects the first word to be a command and next words to be files. This is already wrong, as some commands are made of multiple words (
sort reverse
) and what's more some commands do not accept files as parameters to begin with, so we do not need auto-completion for them. And other commands accept only folders, so autocompleting files should be avoided.I propose to either add a simple specification, which every command should implement, to aid with autocompletion.
Something akin to:
This specification is in no way complete, but it covers the most general cases, which I think should suffice for now.
Or make
Command
implement autocompleting interface through traits. (Possibly with a default implementation).After we decide what to do (and whether to do anything at all), I will be willing to implement it.
The text was updated successfully, but these errors were encountered: