For all conditions that rely on numbers, only whole numbers are (currently) supported.
conditions\:
- - code:"== \"left\" \"right\""\:
+ - code:"== 'left' 'right'"\:
Compare all parameters to be equal.
Requires 2 or more after the code:"==".
For example, code:"if == 'a' 'b' 'c' 'd'" would test: code:"'a' == 'b' && 'b' == 'c' && 'c' == 'd'".
This performs only string-based comparisons.
- - code:"> \"left string\" \"right string\""\:
+ - code:"> 'left string' 'right string'"\:
Compare code:"left" to code:"right" for greater than.
Requires 2 or more after the code:">".
For example, code:"if > 0 1 2 3" would test: code:"0 > 1 && 1 > 2 && 2 > 3".
This performs only number-based comparisons.
- - code:"< \"left string\" \"right string\""\:
+ - code:"< 'left string' 'right string'"\:
Compare code:"left" to code:"right" for less than.
Requires 2 or more after the code:">".
For example, code:"if < 0 1 2 3" would test: code:"0 < 1 && 1 < 2 && 2 < 3".
This performs only number-based comparisons.
- - code:">= \"left string\" \"right string\""\:
+ - code:">= 'left string' 'right string'"\:
Compare code:"left" to code:"right" for greater than or equal to.
Requires 2 or more after the code:">=".
For example, code:"if >= 0 1 2 3" would test: code:"0 >= 1 && 1 >= 2 && 2 >= 3".
This performs only number-based comparisons.
- - code:"<= \"left string\" \"right string\""\:
+ - code:"<= 'left string' 'right string'"\:
Compare code:"left" to code:"right" for less than or equal to.
Requires 2 or more after the code:">=".
For example, code:"if <= 0 1 2 3" would test: code:"0 <= 1 && 1 <= 2 && 2 <= 3".
This performs only number-based comparisons.
- - code:"<> \"left\" \"right\""\:
+ - code:"<> 'left' 'right'"\:
Compare all parameters to be not equal.
Requires 2 or more after the code:"==".
For example, code:"if <> 'a' 'b' 'c'" would test: code:"'a' <> 'b' && 'b' <> 'c' && 'a' <> 'c'".
This performs only string-based comparisons.
- - code:"define \"some define name\""\:
+ - code:"define 'some define name'"\:
Test if one or more names are defined as an environment variable.
For example, code:"if define PWD SHELL" would test if both the code:"PWD" and the code:"SHELL" variables are defined via the environment variables.
- - code:"exist \"file path\""\:
+ - code:"exist 'file path'"\:
Test if file exists.
- For example, code:"if exist \"a.txt\" \"b.txt\"" would test if both the file code:"a.txt" and code:"b.txt" exist.
+ For example, code:"if exist 'a.txt' 'b.txt'" would test if both the file code:"a.txt" and code:"b.txt" exist.
- code:"failure"\:
Test if the previous section operation failed.
- - code:"group \"some mode\" \"some file\""\:
+ - code:"group 'some mode' 'some file'"\:
For example, code:"if group friends a.txt b.txt" would test if both file code:"a.txt" and code:"b.txt" have a group named code:"we".
- - code:"is block character directory fifo link regular socket for \"file path\""\:
+ - code:"is block character directory fifo link regular socket for 'file path'"\:
Test if one or more files exist and if each file is any of the given types.
The given types must be followed by code:"for" to designate where the the file paths begin.
- For example, code:"if is regular directory for \"a.txt\" \"b.txt\"" would test if both the file code:"a.txt" and code:"b.txt" exist and are either of type code:"regular" or type code:"directory".
+ For example, code:"if is regular directory for 'a.txt' 'b.txt'" would test if both the file code:"a.txt" and code:"b.txt" exist and are either of type code:"regular" or type code:"directory".
- - code:"mode is/has \"some mode\" \"some file\""\:
+ - code:"mode is/has 'some mode' 'some file'"\:
Test if one or more files has the exact mode (code:"is") or has at least the given modes (code:"has").
For example, code:"if mode is u+r a.txt b.txt" would test if both file code:"a.txt" and code:"b.txt" only have owner set to read.
For example, code:"if mode has u+r a.txt b.txt" would test if both file code:"a.txt" and code:"b.txt" has owner set to read, and all other modes can be anything.
- code:"if not parameter work"
- code:"if not exist documentation.txt"
- - code:"owner \"some mode\" \"some file\""\:
+ - code:"owner 'some mode' 'some file'"\:
Test if one or more files has the given owner.
For example, code:"if owner me a.txt b.txt" would test if both file code:"a.txt" and code:"b.txt" have an owner named code:"me".
- - code:"parameter \"some parameter name\""\:
+ - code:"parameter 'some parameter name'"\:
Test if one or more names are defined as a code:"parameter" variable.
For example, code:"if parameter verbose silent" would test if both the code:"verbose" and the code:"silent" variables are defined via the code:"parameter" setting.
- code:"context"\:
The context Object represents a name representing simple context or complex combination of context.
Context should wrap some text such that if some text begins with some context, the context should be reset at the end.
- The most basic context is color context, such as: code:"context:\"notice\" This is emphasized text context:\"reset\"".
+ The most basic context is color context, such as: code:"context\:'notice' This is emphasized text context\:'reset'".
The use of IKI in this way is acceptable but it is not perfect.
IKI is not designed to be a replacement to markup.
- The markup code:"<strong>Example</strong>" vs the IKI code:"context:\"notable\" Example context:\"notable\"" has obvious differences in the spaces.
- The IKI by design cannot be used like this: code:"context:\"notable\"Examplecontext:\"notable\"" because the word code:"Example" and the word code:"context" collide.
+ The markup code:"<strong>Example</strong>" vs the IKI code:"context\:'notable' Example context\:'notable'" has obvious differences in the spaces.
+ The IKI by design cannot be used like this: code:"context\:'notable'Examplecontext\:'notable'" because the word code:"Example" and the word code:"context" collide.
This context will respect the programs code:"++light", code:"++dark", and code:"++no_color" parameters.