Editor Variable to ExecuteCommandLineOperation return

Post here questions and problems related to oXygen frameworks/document types.
kirkilj
Posts: 101
Joined: Fri May 14, 2010 12:14 am

Editor Variable to ExecuteCommandLineOperation return

Post by kirkilj » Sat May 16, 2020 11:51 pm

The ExecuteCommandLineOperation has an option to show the results in an Oxygen console table. It would be useful if there was another parameter that would signal that the result should instead be returned as a string that could be used elsewhere.

One way to leverage this capability would be for Oxygen to provide an analog to the xpath_eval editor variable, such as os_eval. We would define other custom editor variables that would gets its value using the os_eval variable.

A hypothetical example would be to define a custom editor variable, called "currentBranch" that would get its value from

Code: Select all

${os_eval ('git rev-parse --abbrev-ref HEAD')}
As it stands today, our writers have to enter it literally whenever they create a new branch of their documentation.

Consideration would need to be made as to whether only the first line of output should be returned and what to do if the command results in an error.

Thoughts?

sorin_carbunaru
Posts: 315
Joined: Mon May 09, 2016 9:37 am

Re: Editor Variable to ExecuteCommandLineOperation return

Post by sorin_carbunaru » Tue May 19, 2020 12:41 pm

Hello John,

I created a feature request for an editor variable that is capable of executing command lines (EXM-45656 - for reference purposes).

What I don't understand is the relationship between ExecuteCommandLineOperation and os_eval. Could you please explain this a little bit more? Or did you mean that users could use the result of the operation in some other ways?

All the best wishes,
Sorin Carbunaru
oXygen XML

kirkilj
Posts: 101
Joined: Fri May 14, 2010 12:14 am

Re: Editor Variable to ExecuteCommandLineOperation return

Post by kirkilj » Tue May 19, 2020 7:43 pm

Hi Sorin,

Apologies. My feature request evolved while I was typing it, and I forgot to delete the first paragraph! My initial though was to add a parameter to the ExecuteCommandLineOperation, before the idea of os_eval came along. However, as long as we're talking about OS shell integration points... ;)

One thing my colleagues mentioned is what would be ideal is if we could indicate which shell to use in a number of customization opportunities in Oxygen. On Windows, the options for us are the legacy cmd shell, PowerShell, and GitBash, although we only care about CMD and Bash. GitBash does have the ability to invoke it with a command line parameter to provide the Bash command to execute.

For an os_eval implementation, perhaps there could be a preference for the default command shell, but also supporting an optional parameter to indicate the shell to use.

A bit more ambitious feature would be something I've mentioned in another forum post or perhaps a support email. It would be wonderful if we could:
  1. pick which shell to use in the External Tools dialog. The console display would show the output from a given shell.
  2. provide a true console that supports interactive input as well as output. Many text editors and IDEs provide that feature, and it precludes a user having to leave the OxygenXML UX to get something done in a separate terminal application.
There appear to be a few related terminal open source Java plugins for Eclipse, such as: which support multiple shell types.

Best Regards,

John

sorin_carbunaru
Posts: 315
Joined: Mon May 09, 2016 9:37 am

Re: Editor Variable to ExecuteCommandLineOperation return

Post by sorin_carbunaru » Wed May 20, 2020 1:56 pm

Hello John,

Could you please give us some more details about how your colleagues would use os_eval? We would like to better/fully understand their use-cases and their workflows. This would help us with the development, the testing, and so on.

One specific thing that we would like to know is where exactly would they use it...

All the best,
Sorin C.

Post Reply