autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

Add autocomplete support for rclone

Open rmorey opened this issue 5 years ago • 6 comments

CLI Tool

rclone syncs files to and from cloud storage providers as well as mounting them, listing them in lots of different ways.

Useful Links

Top Workflows

  • rclone config
  • rclone listremotes
  • rclone lsd remote:path
  • rclone -P --exclude '.*{/**,}' sync /Volumes/Data/ remote:Data
  • rclone mount remote: dir

rmorey avatar May 26 '21 18:05 rmorey

Working on this here: https://github.com/rmorey/autocomplete/blob/rmorey/rclone/dev/rclone.ts

rmorey avatar May 26 '21 20:05 rmorey

What I've done so far is just transform the list of commands with descriptions from the help text into the spec format with args: {} for all. So this gets us simple autocomplete for every command, but nothing else - @cstrnt is this substantial enough for a PR?

rmorey avatar May 26 '21 20:05 rmorey

Hey @rmorey that's awesome! Thank you very much for starting! 😊 While it is totally fine for a spec to just be a skeleton to get merged in, I think this needs some little tweaks.

args: {} tells Fig that the command takes an argument. One example for this would be cd folderName where cdis the name of the command itself and folderName the argument which is passed to the command itself. I just looked up rclone and saw that not all commands take an argument like that. It would be really cool if you could remove args: {} for the commands which don't take an argument. If this is done it would be awesome if you would create a PR :)

Again, thank you very much for your effort and your time! And also let me know if you need some help :)

cstrnt avatar May 26 '21 20:05 cstrnt

Also this page is a really good read 😆 https://fig.io/docs/concepts/cli-skeleton

cstrnt avatar May 26 '21 21:05 cstrnt

args: {} tells Fig that the command takes an argument. ... It would be really cool if you could remove args: {} for the commands which don't take an argument. If this is done it would be awesome if you would create a PR :)

Ahhhh, I misread the comment in the boilerplate! I missed the conditional in "If a subcommand or option takes an argument, you must include the args prop, even if it's an empty object (like below)" I'll remove those and submit a PR.

Also this page is a really good read 😆 https://fig.io/docs/concepts/cli-skeleton

Glad you fixed the link! 😜 (https://twitter.com/RyanMorey/status/1397581270817837061)

Again, thank you very much for your effort and your time! And also let me know if you need some help :)

Glad to help! Fig is a great tool, happy to contribute

rmorey avatar May 26 '21 23:05 rmorey

No worries! This might be a good sign, that we have to update the text to make it more clear!

Thanks for reporting the broken link as well 😆

cstrnt avatar May 27 '21 08:05 cstrnt