Skip to content

Commit c8d6532

Browse files
Frans Meulenbroekspkun
authored andcommitted
fix 2 links, typos, describes args* attributes
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]>
1 parent e3d40dc commit c8d6532

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
See the http://code.google.com/p/klish/source/list for the changes of SVN repository.
1+
See http://libcode.org/projects/klish/repository/revisions for the changes of the git repository.
22
See the http://klish-cli.blogspot.com/ for the release changes and another klish related news.

ISSUES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See the http://code.google.com/p/klish/issues/list for the list of current issues.
1+
See http://libcode.org/projects/klish/issues for the list of current issues.

doc/klish.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The Klish incorporates all the features of clish. See the clish documentation on
4040
* [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.
4141
* [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.
4242
* [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.
4444
* [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.
4545
* [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.
4646
* [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
352352

353353
## The automatic internal variables {#internal_variables}
354354

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.
356356

357357
### `${__cmd}`
358358

@@ -477,7 +477,8 @@ There is a good example of using nested parameters in [optional parameters](opti
477477

478478
## The namespaces or logically nested views {#nested_views}
479479

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.
481482

482483
### Logically nested views
483484

@@ -589,7 +590,7 @@ The typical "configure-view" has the restore="depth" field:
589590

590591
## The optional arguments {#optional_arguments}
591592

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.
593594

594595
The following code creates three optional arguments and the mandatory one:
595596

@@ -662,7 +663,7 @@ Notice the order="true" field within "-c" subcommand definition. Now the "flag"
662663

663664
### The clish compatibility
664665

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.
666667

667668
The Klish emulates clish behaviour when the "prefix" option is defined. The following two [is equivalent.
668669

@@ -851,15 +852,15 @@ The CLISH_MODULE can contain the following tags:
851852

852853
* [OVERVIEW] - once
853854
* [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
859860
* [WATCHDOG] - once
860-
* [HOTKEY] - multiply
861-
* [PLUGIN] - multiply
862-
* [HOOK] - multiply
861+
* [HOTKEY] - multiple
862+
* [PLUGIN] - multiple
863+
* [HOOK] - multiple
863864

864865

865866
## VIEW
@@ -868,9 +869,9 @@ The VIEW tag defines a view. The view aggregates the commands. While the Klish e
868869

869870
The VIEW tag can contain the following tags:
870871

871-
* [NAMESPACE] - multiply
872-
* [COMMAND] - multiply
873-
* [HOTKEY] - multiply
872+
* [NAMESPACE] - multiple
873+
* [COMMAND] - multiple
874+
* [HOTKEY] - multiple
874875

875876
### name {#VIEW_name}
876877
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
922923
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.
923924

924925
### \[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.
925928

926929
### \[args_help\] {#COMMAND_args_help}
930+
The help string for the additional arguments.
927931

928932
### \[escape_chars\] {#COMMAND_escape_chars}
929933

@@ -982,7 +986,7 @@ Specify the name of an internally registered function. The content of the ACTION
982986
### \[shebang\] {#ACTION_shebang}
983987
Defines the scripting language (the binary file) to use for the ACTION script execution.
984988

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.
986990

987991

988992
## OVERVIEW
@@ -1029,7 +1033,7 @@ This tag may be used within the scope of a [COMMAND] element. The PARAM tag defi
10291033

10301034
The VIEW tag can contain the following tags:
10311035

1032-
* [PARAM] multiply
1036+
* [PARAM] multiple
10331037

10341038
### name {#PARAM_name}
10351039

@@ -1257,7 +1261,7 @@ $ clish [options] [script_filename]
12571261

12581262
### Description
12591263

1260-
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.
12611265

12621266
### Options
12631267

0 commit comments

Comments
 (0)