Closed eddiekelleypdx closed 5 years ago
actually this seems to be... redoing? duplicating? your other branch, I'm just going to let you figure out what to save after I tweak the code layout
so, I'd assume ls
to list the local directory personally. maybe something like lsr
for ls remote or something? or do you think it makes more sense to assume remote?
Some FTP clients (like the one included in the GNU Project's Inetutils) will perform a local directory list (or remote listing) when the Tab key is pressed (sometimes it may need to be pressed twice to initiate that listing). When using that software, the 'ls' command will report "Not connected." when used without an active connection, and there doesn't appear to be a local list command available (when glancing at that software's help).
Would it be easy to implement a local directory listing that's displayed after pressing the 'Tab' key, or does this seem like it might be too complex for our interactive shell? The main obstacle there may be the input()
command that we're using to input those commands (which may require a newline-terminated string for input submission)?
Here's an example of using something like tab completion with Python's raw_input()
function: https://stackoverflow.com/questions/5637124/tab-completion-in-pythons-raw-input
Of course, implementing a local vs. remote list command is definitely possible, and may be an easier route to take (i.e., it wouldn't require us to reimplement the interactive shell), but going off of historical FTP client behavior, the ls
command is only used for remote directory listings, so I'd propose that the local list command have some non-standard syntax ;-)
huh, well, honestly I still like the idea of not doing that better, but you're right, that seems to be the convention, so we should probably stick to that. I see one that allows !<command>
for local commands, we could do something like that I guess... I'm not a fan of the tab thing, I believe it's supposed to be part of tab completion and that's a rabbit hole I want nothing to do with.
I can't use a shell without autocomplete, but I'm pretty lazy (and probably won't need to use this shell after March ;-)... If there are multiple commands that will need to use a remote vs. local variant, maybe we should try to establish what that nomenclature will be via Slack?
and don't get me wrong, I agree about autocomplete, but it's nowhere on our backlog, and we're behind on what we do have to do already. if you want to have a go at it I won't stop you though. ;P
That's a big 'pass' on the autocomplete... Let's go with whatever the group consensus is on the local v. remote naming convention (KISS).
The merge of the refactored SFTP class has created some gnarly merge conflicts, so I'm going to close this request, and open another with the ls
command changes.
This pull request / test task implements the
ls
command and associated unit tests Dependent upon PR #36 Closes #20