-
Notifications
You must be signed in to change notification settings - Fork 38
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
[Feature Request] Better scripting support #65
Comments
Can you give example usage of the |
Well, I meant those as different names for the same thing, just not sure what it should be called. E.G.: Instead of saving the profile in
Instead of saving the profile in
Instead of importing the profile from
These examples do not make perfect sense however, since the profiles are saved as directory structures so there's no way to directly represent them as a stream. That could possibly be solved by E.G. using Mainly this is about workflow and automation. A lot of Unix-style tools are built around the idea of connecting multiple processes together with pipes and redirections, so being able to output to STDOUT or take input from STDIN opens a lot of flexibility. For example, I have a script that runs |
Okay, I somewhat get what you're trying to say.
I'm not sure how one would send a whole profile (which is a directory) to a stream, so I can try to send the "path" instead. |
Hm. That could work. Although I think most other tools expect data to come in on STDIN and paths to be given as command line parameters, so it would probably require In the first example, In the second example,
I'm not sure there's much point to doing this with
I was actually wondering— Might it be beneficial to change the entire output format to |
It might be and I can do that. It's not much work but I had a question, do we just send the path to the |
Hm. I guess pipe syntax (E.G.
Depends on how it's handled I guess? I suppose in this case if the file can get that big you might want to save it to disk in a temp file first, and then stream it. Or, if the file structure makes it feasible, the "right" way to do it would probably usually be to output the data in sequence as the file is built. But there shouldn't ever be any need to store the whole file in memory at once— It can be output to STDOUT line-by-line, block-by-block, or even one byte at a time. |
Is your feature request related to a problem? Please describe.
Scriptable tools are useful. Treating "profiles" as opaque units, while possibly convenient for some uses, also hurts flexibility.
Describe the solution you'd like
Support for a simple option like
--stdout
,--save -
,--save /dev/stdout
, or--print <profile>
would be great.If you want to take it further, accepting input from STDIN (E.G.
--i -
) could also be interesting. Then you could do stuff likenc -l -p 1234 | konsave -i -
on one machine andkonsave -s - | nc newLaptop.localLAN 1234
to instantly transfer or synchronize your configuration.Describe alternatives you've considered
The alternative is the current system of opaque "profiles" and "
.knsv
" files, which can be both messy in workflow (I.E. requires mucking with files) and messy in its effect on the system (I.E. saves state in persistent files, ironically creating even more hidden configuration to worry about, plus filepath collisions and so on).Additional context
Since it appears that profiles are file hierarchies and ".knsv"s are ZIP archives, it's not clear what exactly should be emitted.
Personally I think either raw binary data or Base64 would be fine, as long as it's specified in the help text.
The text was updated successfully, but these errors were encountered: