Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Allow for piping commands to an existing instance of cordless #324

Open
Lightseypoo opened this issue Aug 22, 2020 · 7 comments
Open

Allow for piping commands to an existing instance of cordless #324

Lightseypoo opened this issue Aug 22, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@Lightseypoo
Copy link

Lightseypoo commented Aug 22, 2020

What do you want

Commands in cordless would be much more useful if they were callable through shell scripting. As it stands the program only appears to take config directories as arguments and the only way to call commands is via the in-application command window; at least that i can see or find any documentation for. Something along the lines of:

cordless -cmd file-send [args]

Where when calling that command, cordless would look for an existing cordless process and run the command with given args in that process.

Why

This support would be hugely valuable for the purpose of shell scripting and interacting with other programs. An example usage case would be selecting a file in ranger to then upload it via cordless with a single keybind. There is utility for this beyond the example (setting shortcuts to commands which seem to only be callable via the command window, fetching information from cordless for usage in external applications).

I'm having a bit of trouble figuring out what can be accomplished and how with the existing documentation, maybe this is already possible through other means.

@Bios-Marcel
Copy link
Owner

would we do it with filesockets?

@Lightseypoo
Copy link
Author

sounds like as good of an approach as any. At least for linux, im not sure how that would work on other platforms. and i suppose cordless would need to check for an existing process on startup

@Bios-Marcel
Copy link
Owner

Bios-Marcel commented Aug 23, 2020

Hm, i dunno if filesockets work on windows. Instance checking could be avoided by giving the file the PID as name, then you could technically talk zo all active clients

@Bios-Marcel Bios-Marcel added the enhancement New feature or request label Aug 23, 2020
@Lightseypoo
Copy link
Author

Hm, i dunno if filesockets work on windows. Instance checking could be avoided by giving the file the PID as name, then you could technically talk zo all active clients

I like the sound of this approach. No need to impose a restriction to 1 active cordless process at a time.

@Bios-Marcel
Copy link
Owner

Supposedly this has been implemented: golang/go@76c4587

However, I was unable to find it in the commit notes. This would also require us to bump the minimum version up to Go 1.15

@Lightseypoo
Copy link
Author

Supposedly this has been implemented: golang/go@76c4587

However, I was unable to find it in the commit notes. This would also require us to bump the minimum version up to Go 1.15

Is this a major issue or deal breaker? I am unaware of the connotations that come with that change as I'm very new to Go in particular.

@Bios-Marcel
Copy link
Owner

Bios-Marcel commented Aug 24, 2020

Well I am already annoyed by the amount of goons that don't read the readme, try to compile with an outdated go version and ask me what's going on ^^ And I am sure it's gonna get worse

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants