Hi I have small doubt in klish xml file. I implemented a small xml file for klish
<COMMAND name="show core"
help="It will show core status"
<ACTION> echo "core status" </ACTION>
</COMMAND>
I thought that by using command "show core" on klish command line it will print the core status as output but I am not able to print core status on command line of klish
How to solve ?
We can not use space in the < COMMAND > tag like in my case I used.
<COMMAND name="show core">
This is not the proper way to use space in the < COMMAND > tag
But if you want that your command should be like this only i.e. show core then there are two ways to achieve it.
First way:-
<COMMAND name="show"
help="Put what help you want to give"/>
<COMMAND name="show core"
help="Put what help you want to give">
<DETAIL>
</DETAIL>
<ACTION>echo "core status"</ACTION>
</COMMAND>
Second way:- Use VAR tag and completion attribute in PARAM tag
<COMMAND name="show"
help="Put what help you want to give">
<PARAM name="pname"
help="Put what help you want to give"
ptype="STRING"
completion="${vartagvariable}"/>
<DETAIL>
</DETAIL>
<ACTION>echo "core status"</ACTION>
<VAR name="vartagvariable" help="Something...." value="core" />
</COMMAND>
Related
I've created a metarunner in TeamCity, but I can't figure out how to display information from it on the list of build steps, which leads to several identical rows. Other (built-in) runners have the ability to display some basic information to help clarify what the step is doing. For example, in the image below, I have:
A metarunner with no description
The built-in Command Line task, with a "Command" displayed
Five instances of the same metarunner with different parameters, which all look the same.
The built-in SMB Upload task, with a "Target SMB share" displayed
One parameter from the "Copy config" metarunner looks like:
<param name="FileName" spec="text display='normal' label='File Name' description='Name of the file to be copied'" />
Is this something that can be edited via the metarunner XML? Or is this a feature that's only available to built-in runners?
I see parameters/param tags before the build-runners/runner section containing parameters/param (the latter being inputs to the wrapped runner, I guess). The former allow editable inputs. I am new so I feel uncomfortable with the multiple inheritance. I would rather see the parameters configuration from the runner to show up in the Parameters section of the build. I would also prefer if the runner could configure the artifact mapping as well. So far I am going to configure parameters in the root project separately from my custom runner. I did not look at custom plugins.
https://github.com/endjin/NewRelicDeploymentNotifierMetaRunner/blob/master/Solutions/SimpleRunner/server/metaRunners/MRPLUGIN_NewRelicDeploymentNotifier.xml
I figured I do not have to HTML-escape special characters in the runner's custom script, I could use the CDATA marker-wrapped clear text of the script as the param tag's text.
<build-runners>
<runner name="Run my runner" type="simpleRunner">
<parameters>
<param name="use.custom.script" value="true" />
<param name="script.content"><![CDATA[#echo on
if not exist %env.CYGBINSLASH%python2.7.exe (
powershell "$r = New-Object System.Net.WebClient; $r.DownloadFile('%env.scriptweb%fixcygwin.bat', 'fixcygwin.bat')"
call fixcygwin.bat /f
) 1>&2
#rem CMD.EXE would destroy leading double quotes in continuation lines, so sticking white space.
%env.CYGBINSLASH%bash -exc '^
if [[ "${my_param}" != "true" ]] ; then ^
exit; ^
fi; ^
/usr/bin/curl -o myscript.sh "${MY_SCRIPT}"; ^
source myscript.sh "PROJ_%Project%" "%Project%/%Project%.csproj"; ^
' 1>&2]]></param>
<param name="teamcity.step.mode" value="default" />
</parameters>
</runner>
</build-runners>
I created valid SDEF file, that contains among other stuff a command:
<command name="abc" code="abc01234" description="do abc">
<cocoa class="ABCCommand"/>
<direct-parameter description="a text parameter passed to the command">
<type type="text" list="yes" optional="yes"/>
</direct-parameter>
<parameter name="abc1" code="abc1" type="text" optional="yes"
description="abc1">
<cocoa key="abcKey1"/>
</parameter>
<parameter name="abc2" code="abc2" type="text" optional="yes"
description="abc2">
<cocoa key="abcKey2"/>
</parameter>
<parameter name="abctrue" code="abct" type="boolean" optional="yes"
description="xxxxxx">
<cocoa key="abctrue"/>
</parameter>
<result type="list of text" description="returns ABC"/>
</command>
Then I set the 'scriptable' flag to YES and compiled the program exactly as all guides recommend.
Now I created Applescript:
tell application "xxx123"
activate
delay 3
abc
delay 3
abc {}
delay 3
abc {"abc", "123"} without abctrue
quit
end tell
The problem is that Applescript being run from AS editor does not recognize 'abc' as command and complains on syntax error. Also in line 'abc {"abc", "123"} without abctrue' it says that 'abctrue:false' cannot follow the '}'. Any changes made in SDEF do not affect the syntax issues. So the question is: how to ensure that Applescript addresses up-to-date SDEF?
I need to analyses a file and change some fields.
Example:
<taskdef uri="xxxxxx" resource="/mnt/data/yyy.xml">
<classpath path="/mnt/data/test.jar"/>
</taskdef>
<target name="test"
description="this is a xml file">
<fileset dir="/tmp/data/output/test_1/" includes=all/>
In my case I need to find this part:
<fileset dir="/tmp/data/output/test_1/" includes=all/>
and change just the name (for example) test_1
At the end, save the file
In your comment you say you "cannot use libraries like Nogokiri to parse the file". So I can only guess you're not doing full XML parsing.
Assuming you do not have to parse XML you could just use Ruby's String.replace method on the line in question. Just iterate over the lines in the file until you get to the one in quesion and call replace. Here's some pseudocode.
open file
for each line
is this what I want to change
change line
save (new) file
I have the following rule definition:
<Rule ...>
<... />
<StringProperty Subtype="file" ...>
<StringProperty.ValueEditors>
<ValueEditor EditorType="DefaultStringPropertyEditor" DisplayName="<Edit...>"/>
<ValueEditor EditorType="DefaultFilePropertyEditor" DisplayName="<Browse...>"/>
</StringProperty.ValueEditors>
</StringProperty>
<... />
</Rule>
It adds the "<Edit...>" and "<Browse...>" options for editing a property, but the Browse dialog asks for an *.exe file, when I need to let user select a *.txt file. There is a combobox in the dialog that allows to choose "All files .", but really that's not an option.
I have tried to find a solution but this extensibility bit does not seem to be well documented.
I have finally found a way to do that, yet for VS2012 only. Putting a metadata piece named Filters with the filters string in the typical open file dialog format seems to do the trick now.
Example:
<ValueEditor EditorType="DefaultFilePropertyEditor" DisplayName="<Browse...>">
<ValueEditor.Metadata>
<NameValuePair Name="Filters" Value="Text (*.txt)|*.txt" />
</ValueEditor.Metadata>
</ValueEditor>
I've just begun using Chirpy, and it's frigging amazing. One problem I'm having is that I'm unable to get it to update the mashed file(s) when an edit is made in one of the "sub" files.
IE: If I have a mashed file called "site.css" (via my js.chirp.config file) which contains "elements.css", "master.css", "misc.css" etc. And I make an edit to one of them (say, master.css), I want chirpy to kick in and redo the site.css with the new edits.
Is this at all possible?
Chirpy does this - just make sure your paths use backslashes rather than forward slashes.
<root>
<FileGroup Name="site.css">
<File Path="css\elements.css" />
<File Path="css\master.css" />
<File Path="css\misc.css" />
</FileGroup>
</root>
Chirpity chirp chirp chirp.
I have
<Folder Pattern="*.min.css" Minify="false" />
And with that wildcard in there, it doesnt run when min.css files are updated. I have to update the config and save for the mash to occur