专利汇可以提供Method and system for a scriptable command line interface专利检索,专利查询,专利分析的服务。并且A method and system for a scriptable command line interface is described. A script is written and associated with each command. When an input is received at a command line interface, the input is parsed to identify a command and any associated parameters. The script associated with the command is invoked, and parameters associated with the command are sent to an application to configure the application in accordance with the script. The application is executed and data is generated. The script receives the data from the application and formats the data for output.,下面是Method and system for a scriptable command line interface专利的具体信息内容。
What is claimed is:
1. Technical Field
Embodiments of the invention relate to the field of user interfaces, and more specifically to a scriptable command line interface.
2. Background Information and Description of Related Art
A typical command line interface (CLI) execution model begins with a user entering a command in a shell. The command is parsed by a CLI engine. One or more applications may then be invoked by the command. The invoked application will process the command and generate and format any data for output. This output is then displayed to the user. If a new format for the output is desired, a change to the application software code can be made, but the application software code must be then be recompiled. Therefore, the operation of the electronic computing device, such as a network device, must be interrupted for a period of time for even a minor change to the application software code, potentially causing much inconvenience to users and making it impractical to change output format.
The invention may best be understood by referring to the following description and accompanying drawings that are used to illustrate embodiments of the invention. In the drawings:
Embodiments of a system and method for a scriptable command line interface are described. A script is written and associated with each command. When an input is received at a command line interface, the input is parsed to identify a command and any associated parameters. The script associated with the command is invoked, and parameters associated with the command are sent to an application to configure the application in accordance with the script. The application is executed and data is generated. The script receives the data from the application and formats the data for output.
Referring to
System 100 includes a shell 104 to receive commands input from a user and a command line interface 102 to parse the commands received from the shell. The command line interface 102 may invoke one or more applications, such as 110, 112, or 114, in response to the received commands.
The command line interface 102 includes a list of commands 106 and a plurality of scripts 108. Each script is associated with a command and is invoked when the associated command is received by the command line interface. The scripts 108 may be written in various scripting languages, such as TCL (Tool Command Language), PERL (Practical Extraction and Report Language), Python, Bourne Shell, or C Shell. In one embodiment, the scripts are written by a user. In response to a command entered in the shell, the script associated with the command sends parameters as input to an application. The parameters may include arguments entered by a user in the command line in conjunction with entering the command. The parameters may include other data used to configure the application according to user preference. In one embodiment, the parameters sent by the script as input to the application are encoded in XML (Extensible Markup Language).
The application receives the input from the script and processes the command and associated parameters. Data is then generated by the application. This data is typically encoded according to a scheme understood by the command line interface or the shell. For example, a binary or proprietary encoding scheme may be used to encode the data generated by the application. In one embodiment, XML is used to encode the data generated by the application. The script associated with the command receives the encoded data from the application and formats the data for output.
The script may be modified at any time to change the way the data received from the application is formatted for output. The script may also be modified to change the parameters sent to the application. By changing the scripts, it is unnecessary to edit and recompile the application for changes to output format.
As an example, suppose that a route manager application accepts and executes a command as follows:
show iproute <ip_address> <netmask> <gateway> <metric>
An example of a script written in TCL for the command above is as follows:
# Get command line arguments.
array set args $argv
# Build the XML configuration data.
set configuration \
# Send the configuration data to application and receive reply.
set reply [getbulk $configuration 1]
# Parse XML reply and format display.
buildarray $reply-simple
if [string compare $xmlData(reply.status) “SUCCESS”] {
} else {
}
The getbulk, buildarray, and show commands are extended TCL commands that send parameters to the application to configure the application, receive data from the application, parse the received data, and display the output to a user.
As will be appreciated by those skilled in the art, a system incorporating an embodiment of the invention may be implemented in software, firmware, or hardware. The content for implementing an embodiment of the method of the invention, for example, computer program instructions, may be provided by any machine-readable media which can store data that is accessible by system 100, as part of or in addition to memory, including but not limited to cartridges, magnetic cassettes, flash memory cards, digital video disks, random access memories (RAMs), read-only memories (ROMs), and the like. In this regard, the system 100 is equipped to communicate with such machine-readable media in a manner well-known in the art.
It will be further appreciated by those skilled in the art that the content for implementing an embodiment of the method of the invention may be provided to the system 100 from any external device capable of storing the content and communicating the content to the system 100. For example, in one embodiment of the invention, the system 100 may be connected to a network, and the content may be stored on any device in the network.
In this description, numerous specific details have set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
Reference throughout this specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. Thus, the appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
While the invention has been described in terms of several embodiments, those of ordinary skill in the art will recognize that the invention is not limited to the embodiments described, but can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of limiting.
标题 | 发布/更新时间 | 阅读量 |
---|---|---|
密码找回方法、装置、网络设备及计算机可读存储介质 | 2020-05-11 | 171 |
用于在一个或多个云系统上便携部署应用的方法和系统 | 2020-05-14 | 544 |
一种基于命令行动态替换用于多设备共镜像的方法 | 2020-05-16 | 259 |
一种用于计算热化学非平衡绕流的处理系统及方法 | 2020-05-13 | 197 |
基于树莓派的人脸识别系统 | 2020-05-14 | 844 |
升级的Cloud Foundry平台系统 | 2020-05-14 | 536 |
基于Kubernetes平台的联盟区块链系统 | 2020-05-17 | 366 |
深度学习作业处理方法、装置、设备及存储介质 | 2020-05-20 | 576 |
一种基于OpenCL的Bitslicing-KLEIN的快速实现方法 | 2020-05-15 | 328 |
ONU透传模式的配置方法及系统 | 2020-05-18 | 871 |
高效检索全球专利专利汇是专利免费检索,专利查询,专利分析-国家发明专利查询检索分析平台,是提供专利分析,专利查询,专利检索等数据服务功能的知识产权数据服务商。
我们的产品包含105个国家的1.26亿组数据,免费查、免费专利分析。
专利汇分析报告产品可以对行业情报数据进行梳理分析,涉及维度包括行业专利基本状况分析、地域分析、技术分析、发明人分析、申请人分析、专利权人分析、失效分析、核心专利分析、法律分析、研发重点分析、企业专利处境分析、技术处境分析、专利寿命分析、企业定位分析、引证分析等超过60个分析角度,系统通过AI智能系统对图表进行解读,只需1分钟,一键生成行业专利分析报告。