Method and system for implementing command line input

An implementation method and command line technology, applied in the field of command line parsing, can solve problems such as unrealistic, large workload, and inability to expand, and achieve the effect of simple implementation, reduced workload, and reduced number of registrations

Active Publication Date: 2021-03-16
FENGHUO COMM SCI & TECH CO LTD
View PDF13 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

There are too many combinations, it is obviously unrealistic to list all combinations, and the workload is huge, which brings certain difficulties to registration and later implementation, and cannot be expanded

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system for implementing command line input
  • Method and system for implementing command line input
  • Method and system for implementing command line input

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0078] The realization method of command line input of the present invention comprises steps:

[0079] S101. Define the enumeration according to all optional keywords that need to be supported by the custom command line. The form of defining the custom command line is: the keywords and parameters that must be input are placed in front, and the optional keywords and parameters are placed before all must be input After the , the optional keywords are in no particular order. Except for the keywords and parameters that must be entered, all optional keywords and parameters are replaced by the string PS.

[0080] S102. Define a data structure cmd_param_t to associate each optional keyword, corresponding help information and corresponding parameter range information. If there is no parameter, the range can be represented by empty. The help information includes Chinese and English, which is common information on the command line, and is used to give user operation prompts.

[0081] ...

no. 2 example

[0087] In this embodiment, the form, data structure, array and parsing command of the custom command line are defined according to the first embodiment. On the basis of the first embodiment, when the user-defined parsing function is analyzing the user-defined command line being input, it is judged whether the currently input optional keyword matches the optional keyword stored in the array, and if it matches, further judges whether the current Whether there is a logical conflict between the input optional keyword and the already input optional keyword, if there is no logical conflict, and the parameter that the user continues to input belongs to the corresponding parameter range in the array, then the current optional keyword and the corresponding If the parameter is legal, the current optional keyword is processed. If there is the next keyword, continue processing; if not, the function of custom command line can be executed.

[0088] Among them, if the previously input option...

no. 3 example

[0090] In this embodiment, on the basis of the first embodiment and the second embodiment, when the user-defined parsing function judges whether the currently input optional keyword matches the optional keyword stored in the array, an associative method can be used, Auto-completion of optional keywords for the current section of the input.

[0091] If the currently input optional keyword is partly the same as an optional keyword stored in the array, it indicates that it matches, and the optional keyword currently input is supplemented directly according to the optional keyword stored in the array. And extract the optional keyword to replace the character string PS used in the registration of the corresponding optional keyword, and obtain the help information corresponding to the keyword and the corresponding parameter range.

[0092] For example, if the currently input optional keyword is trac, and an optional keyword stored in the array is traceroute, then the two are partly ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

A method and system for implementing command line input, relating to the technical field of command line analysis, the method includes: defining a custom command line, in which optional keywords and parameters are placed behind the required input and replaced by strings; defining an analysis The custom parsing function of the custom command line is bound to the custom command line registered on the command tree; judging whether the optional keywords and parameters are legal through the custom parsing function, and at the same time, Optional keywords that are partially entered are automatically supplemented based on custom command line prototypes on the command tree. The invention supports random combination input of optional keywords and parameters without considering the number and sequence of optional keywords and parameters, facilitates command line registration and implementation, reduces workload, and can be expanded later.

Description

technical field [0001] The invention relates to the technical field of command line analysis, in particular to a method and system for realizing command line input. Background technique [0002] Various existing products for data communication, such as switches, routers, firewalls, modems, PON (Passive Optical Network, passive optical network), GTN (General Transport Network, general transport network), PTN (Packet Transport Network, packet transmission network), etc., will provide a management method called command line, that is, the user enters a specific command line (expressed as a string of strings), which is parsed by the command line kernel analysis program in the device to obtain the user's operation intention , and then execute and feedback the result to the user. A simple example, such as the ping command in the windows operating system, is a command line. A common practice in the industry is to store all command line prototypes in the form of a command tree. Af...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/30
CPCG06F9/30003G06F9/30094
Inventor 陶阳
Owner FENGHUO COMM SCI & TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products