Command line import/export

Here you are welcome to post Push2Run feature requests
Post Reply
palfore
Posts: 2
Joined: Thu Mar 11, 2021 1:52 pm

Command line import/export

Post by palfore »

I'm trying to automatically import/export different profiles. Is there a way to avoid going through the GUI? Would it be difficult to add the option to import/export via the command line? Commands can already be executed, but I'm not sure if there are any existing flags for different features. I'm thinking something like:

Code: Select all

Push2Run --import "path/to/file"
Thanks!
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Command line import/export

Post by RobLatour »

Currently, that is not fully possible.

You can however already type the full name (including the extension) of a .p2r file at the cmd prompt to have it imported. However, the GUI does pop-up asking you to confirm you want it imported.

So to be clear, if you have a file called "calculator.p2r", just enter
calculator.p2r
at the command prompt.

I will need to look further into this as a feature request.
palfore
Posts: 2
Joined: Thu Mar 11, 2021 1:52 pm

Re: Command line import/export

Post by palfore »

Thanks for the information! That does make things easier than what I was doing. It looks like this always starts with the imported commands off. Is there a way to change that, or is there a way to turn all commands on with a single click rather than individually? The master switch can turn them all off, but not on.
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Command line import/export

Post by RobLatour »

Starting with imported commands switched off is by design.

The whole idea behind this is that after you import something you will have an opportunity to have a good look at it, and then purposefully turn it on before it starts to run. This to help avoid inadvertently importing and running something that you might not want.
palfore
Posts: 2
Joined: Thu Mar 11, 2021 1:52 pm

Re: Command line import/export

Post by palfore »

I managed to automate almost all of the "profile switching" using Python. The only thing I can't do is enable the commands automatically and if a "profile" has many commands it is quite tedious to manually turn them all on. I know I'm sort of pushing your software (which is awesome btw!) but I'm wondering if you may consider adding a setting (with an appropriate warning to the user) that allows commands to be imported in the on state. Or, to make the manual process easier, a button to switch all commands on, or the ability to highlight multiple commands at once.

Or - and this may be a tiny bug/oversight - but after using F9 (to switch a command on) followed by the down arrow (to move to the next command), the selection goes to the top (master switch) and I have to either click or press the down arrow many times to get back to where I was. If it stayed where it was, then I could at least manually spam F9/downarrow.

I'm trying to think of what would be the easiest solution, and I appreciate your responses and time. Thanks!
Last edited by palfore on Sat Mar 13, 2021 9:07 am, edited 1 time in total.
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Command line import/export

Post by RobLatour »

Thanks again for your feedback palfore.

I will look at adding some new options for:
1 - confirmations related to imports
2 - imported cards being turned either on or off by default

Also, thanks for pointing out the bug, I look at fixing it too.
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Command line import/export

Post by RobLatour »

I had some time this afternoon so I made and tested the changes described above in a beta copy of the next release of the program.

If you would like an opportunity to try it out and provided additional feedback please let me know at info@push2run.com

If I don't hear back from you, I will release the update afterI get the help documentation updated as well.
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Command line import/export

Post by RobLatour »

Thanks again for the feedback palfore, as well as for your review of the beta.

A new version of the program, version 3.5.3, has now been generally released with these changes included.
Post Reply