You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replaced two references to code.google.com with references to libcode.org
Fixed several typo's (e.g. multiply should be multiple).
Added a bit of documentation for the args and args_help attributes
Fixed text at a few places
Signed-off-by: Frans Meulenbroeks <[email protected]>
Copy file name to clipboardExpand all lines: doc/klish.md
+23-19Lines changed: 23 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ The Klish incorporates all the features of clish. See the clish documentation on
40
40
* [CLISH_VIEW The initial view redefinition]. User can define CLISH_VIEW environment variable to set initial view instead of the initial view from STARTUP tag.
41
41
* [Klish_examples The Klish specific XML examples]. The Klish source tree contain the Klish specific XML examples that show basic CISCO-like interface to configure network interfaces and routing in Linux system.
42
42
* [sequence The ordered sequences] support in user configuration. In some cases the ordered numerated lists is needed. The example is a CISCO-like access lists in which the order of entries is important. The entries can be addressed by the line number.
43
-
* [internal_variables The automatic internal variables]. For each command the Klish engine generates the automatic variables that can be used the same way as a variables origin from PARAM tags. These are current command line (`${__cmd}`), the whole entered line (`${__line}`) etc.
43
+
* [internal_variables The automatic internal variables]. For each command the Klish engine generates the automatic variables that can be used the same way as a variables originating from PARAM tags. These are current command line (`${__cmd}`), the whole entered line (`${__line}`) etc.
44
44
* [builtin_functions The Klish specific builtin functions]. The clish contain a set of builtin functions (that don't need a scripting within ACTION tag). The additional Klish specific builtin functions is available.
45
45
* [conditional_param The conditional parameters] support. The [PARAM parameter] can be dynamically enabled or disabled depending on the condition. The condition have the syntax same as standard /bin/test utility. So the [PARAM parameter] visibility can depend on the previous [PARAM parameters] values.
46
46
* [locking_mechanism The locking mechanism]. The locking mechanism allows to execute several instances of clish utility (or another programs based on libclish library) simultaneously without conflicts.
@@ -352,7 +352,7 @@ Some keys has predefined hardcoded behaviour. If key has a predefined behaviour
352
352
353
353
## The automatic internal variables {#internal_variables}
354
354
355
-
The Klish engine generates the automatic variables that can be used the same way as a variables origin from [PARAM] or [VAR] tags. To specify these variables use ${`<name>`} syntax. The variables will be expanded before execution of [ACTION] script or before using some tag's fields that is dynamic and allow to use variables. The example of such field is [CONFIG]'s "pattern" attribute.
355
+
The Klish engine generates the automatic variables that can be used the same way as a variables originating from [PARAM] or [VAR] tags. To specify these variables use ${`<name>`} syntax. The variables will be expanded before execution of [ACTION] script or before using some tag's fields that is dynamic and allow to use variables. The example of such field is [CONFIG]'s "pattern" attribute.
356
356
357
357
### `${__cmd}`
358
358
@@ -477,7 +477,8 @@ There is a good example of using nested parameters in [optional parameters](opti
477
477
478
478
## The namespaces or logically nested views {#nested_views}
479
479
480
-
The tag [allows to import the command set from the specified view into another view. So these commands can be used within target view. It allows to create logically nested views. The further view in hierarchy can use commands of previous views. The behaviour is like a CISCO modes (there is the availability to use "configure"-mode commands from "config-if" mode). See the [NAMESPACE](NAMESPACE]) for the tag description.
480
+
The tag [NAMESPACE] allows to import the command set from the specified view into another view, using the "ref" attribute.
481
+
So these commands can be used within target view. It allows to create logically nested views. The further view in hierarchy can use commands of previous views. The behaviour is like a CISCO modes (there is the availability to use "configure"-mode commands from "config-if" mode). See the [NAMESPACE](NAMESPACE]) for the tag description.
481
482
482
483
### Logically nested views
483
484
@@ -589,7 +590,7 @@ The typical "configure-view" has the restore="depth" field:
589
590
590
591
## The optional arguments {#optional_arguments}
591
592
592
-
The command arguments can be optional. The [tag supports "optional" parameter that specify whether parameter is optional. It can be a sequence of optional parameters. The order of optional parameters define the order to validate values. If the value was validated by optional parameter the next optional parameters will not validate this value. Each parameter can be specified only once. See the [PARAM](PARAM]) for the tag description.
593
+
The command arguments can be optional. The [PARAM] tag supports "optional" parameter that specify whether parameter is optional. It can be a sequence of optional parameters. The order of optional parameters define the order to validate values. If the value was validated by optional parameter the next optional parameters will not validate this value. Each parameter can be specified only once. See the [PARAM](PARAM]) for the tag description.
593
594
594
595
The following code creates three optional arguments and the mandatory one:
595
596
@@ -662,7 +663,7 @@ Notice the order="true" field within "-c" subcommand definition. Now the "flag"
662
663
663
664
### The clish compatibility
664
665
665
-
The [clish](PARAM]) has the optional parameters support too but there is a differencies. The "prefix" [option definition means that parameter is optional and the prefix must be followed by argument with "ptype" specified in the same [PARAM](PARAM]). So the parameter without prefix cannot be optional.
666
+
The [clish](PARAM]) has the optional parameters support too but there is a differences. The "prefix" [option definition means that parameter is optional and the prefix must be followed by argument with "ptype" specified in the same [PARAM](PARAM]). So the parameter without prefix cannot be optional.
666
667
667
668
The Klish emulates clish behaviour when the "prefix" option is defined. The following two [is equivalent.
668
669
@@ -851,15 +852,15 @@ The CLISH_MODULE can contain the following tags:
851
852
852
853
* [OVERVIEW] - once
853
854
* [STARTUP] - once
854
-
* [PTYPE] - multiply
855
-
* [COMMAND] - multiply
856
-
* [VIEW] - multiply
857
-
* [NAMESPACE] - multiply
858
-
* [VAR] - multiply
855
+
* [PTYPE] - multiple
856
+
* [COMMAND] - multiple
857
+
* [VIEW] - multiple
858
+
* [NAMESPACE] - multiple
859
+
* [VAR] - multiple
859
860
* [WATCHDOG] - once
860
-
* [HOTKEY] - multiply
861
-
* [PLUGIN] - multiply
862
-
* [HOOK] - multiply
861
+
* [HOTKEY] - multiple
862
+
* [PLUGIN] - multiple
863
+
* [HOOK] - multiple
863
864
864
865
865
866
## VIEW
@@ -868,9 +869,9 @@ The VIEW tag defines a view. The view aggregates the commands. While the Klish e
868
869
869
870
The VIEW tag can contain the following tags:
870
871
871
-
* [NAMESPACE] - multiply
872
-
* [COMMAND] - multiply
873
-
* [HOTKEY] - multiply
872
+
* [NAMESPACE] - multiple
873
+
* [COMMAND] - multiple
874
+
* [HOTKEY] - multiple
874
875
875
876
### name {#VIEW_name}
876
877
The unique name of the VIEW. The VIEW can be referred by this name. For example the "view" field of [COMMAND] tag can refer to this name. The "name" field can contain letters, digits, hyphens, underscores. The name must not begin with the underscore.
@@ -922,8 +923,11 @@ The "ref" field is used to create a [command alias](#command_alias). If the "ref
922
923
This field controls the access rights for the COMMAND. If the access is denied then the user can't use command. Generally the content of this field is arbitrary. It means that the real function that controls permissions can be set by [HOOK] tag. By default (builtin function) the "access" field contain the list of UNIX groups to grant access to. The groups are separated by ":" symbol. If access field is not defined the access is granted.
923
924
924
925
### \[args\] {#COMMAND_args}
926
+
The value of this optional attribute specifies the name of a variable. This variable will contain all that is left over after processing all PARAMs.
927
+
If this field is present the attribute args_help must also be present. If this field is not present it is not possible to enter additional arguments.
925
928
926
929
### \[args_help\] {#COMMAND_args_help}
930
+
The help string for the additional arguments.
927
931
928
932
### \[escape_chars\] {#COMMAND_escape_chars}
929
933
@@ -982,7 +986,7 @@ Specify the name of an internally registered function. The content of the ACTION
982
986
### \[shebang\] {#ACTION_shebang}
983
987
Defines the scripting language (the binary file) to use for the ACTION script execution.
984
988
985
-
Default is the shebang defined within [STARTUP] tag using "default_shebang" field. If the "default_sheband" is undefined the "/bin/sh" is used.
989
+
Default is the shebang defined within [STARTUP] tag using "default_shebang" field. If the "default_shebang" is undefined the "/bin/sh" is used.
986
990
987
991
988
992
## OVERVIEW
@@ -1029,7 +1033,7 @@ This tag may be used within the scope of a [COMMAND] element. The PARAM tag defi
The clish is command line interface shell. The available shell commands and its actions are defined by XML configuration files. The clish utility can get input commands from terminal in interactive mode, from files specified in command line (multiply "script_filename" arguments) or standard input.
1264
+
The clish is command line interface shell. The available shell commands and its actions are defined by XML configuration files. The clish utility can get input commands from terminal in interactive mode, from files specified in command line (multiple "script_filename" arguments) or standard input.
0 commit comments