CN111045766B - Method and device for outputting prompt information based on command line interface - Google Patents

Method and device for outputting prompt information based on command line interface Download PDF

Info

Publication number
CN111045766B
CN111045766B CN201911165840.2A CN201911165840A CN111045766B CN 111045766 B CN111045766 B CN 111045766B CN 201911165840 A CN201911165840 A CN 201911165840A CN 111045766 B CN111045766 B CN 111045766B
Authority
CN
China
Prior art keywords
command
parameter
target
command parameter
prompt information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911165840.2A
Other languages
Chinese (zh)
Other versions
CN111045766A (en
Inventor
朱明达
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201911165840.2A priority Critical patent/CN111045766B/en
Publication of CN111045766A publication Critical patent/CN111045766A/en
Application granted granted Critical
Publication of CN111045766B publication Critical patent/CN111045766B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

The application provides a method and a device for outputting command parameter prompt information based on a command line interface, wherein the method is applied to a system, command parameters in system commands maintained by the system are respectively marked with command parameter identifications; wherein, the same command parameters included in the system commands are respectively marked with different command parameter identifications; the method comprises the following steps: acquiring a command keyword input by a user on the command line interface; responding to the command keyword, and determining a target system command of the system command maintained by the system, wherein the target system command comprises the command keyword; matching the command parameter identification marked by the target command parameter corresponding to the command keyword in the target system command with the prompt information identification in the configuration file corresponding to the target system command; and outputting the prompt information corresponding to the matched prompt information identifier as the prompt information of the target command parameter.

Description

Method and device for outputting prompt information based on command line interface
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for outputting prompt information based on a command line interface.
Background
To facilitate maintenance of the network device, a user may send commands through a command line interface. Generally, a user may access a network device to be maintained through a connection manner such as a console and telnet, and input a command (command, which is composed of several command parameters) through a command line interface (command line interface, which is an interactive terminal interface) to implement maintenance of the network device.
Since the commands for maintaining the network device by the user are more and more complicated at present, the user may not know the complete command parameters included in the command to be input when inputting a certain command. In order to solve the problem, a user can firstly check prompt information corresponding to command parameters forming the command through a command line interface and input a correct command based on the prompt information.
Therefore, a method for outputting command parameter prompt information based on a command line interface is needed.
Disclosure of Invention
In view of this, a method for outputting command parameter prompt information based on a command line interface is applied to a system, wherein command parameters included in system commands maintained by the system are respectively marked with command parameter identifiers; the method includes that the same command parameters included in the system command are respectively marked with different command parameter identifiers:
acquiring a command keyword input by a user on the command line interface;
responding to the command keyword, and determining a target system command of the system command maintained by the system, wherein the target system command comprises the command keyword;
matching the command parameter identification marked by the target command parameter corresponding to the command keyword in the target system command with the prompt information identification in the configuration file corresponding to the target system command;
and outputting the prompt information corresponding to the matched prompt information identifier as the prompt information of the target command parameter.
The application also provides a device for outputting command parameter prompt information based on the command line interface, which is applied to a system, wherein command parameters in system commands maintained by the system are respectively marked with command parameter identifications; wherein, the same command parameters included in the system commands are respectively marked with different command parameter identifications; the above-mentioned device includes:
the acquisition module is used for acquiring the command keywords input by the user on the command line interface;
the determining module is used for responding to the command keyword, and determining a target system command of the system command maintained by the system, wherein the target system command comprises the command keyword;
the matching module is used for matching the command parameter identifier marked by the target command parameter corresponding to the command keyword in the target system command with the prompt information identifier in the configuration file corresponding to the target system command;
and the output module is used for outputting the prompt information corresponding to the matched prompt information identifier as the prompt information of the target command parameter.
According to the scheme, the command parameter identifications are marked respectively due to the command parameters included in the system commands for system maintenance; when the prompt information corresponding to the target command parameter is obtained through the configuration file, the command parameter identifier marked by the command parameter is matched with the prompt information identifier in the configuration file, and the prompt information corresponding to the matched prompt information identifier is output as the prompt information of the target command parameter, so that the prompt information corresponding to the command parameter in the configuration file can be definitely determined, and the situation that the prompt information corresponding to the command parameter in the configuration file cannot be determined is avoided.
Drawings
FIG. 1 is a flowchart of a method for outputting command parameter prompt information based on a command line interface according to the present application;
FIG. 2 is a diagram of an operating system architecture shown in the present application;
FIG. 3 is a block diagram of an apparatus for outputting command parameter notification information based on a command line interface.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items. It should also be understood that the word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
In the related art, the commands for maintaining the network devices are generally pre-defined by a developer. It should be noted that the above command generally consists of several command parameters; the command parameters may include fixed command parameters and variable command parameters; wherein, the fixed command parameter can represent the same content in different commands; for example, ip (a fixed parameter) may indicate the same content "ip address" in different commands. The variable command parameter generally indicates different contents in different commands, and the variable command parameter generally indicates a type of parameter having the same format characteristic. For example, a.b.c.d (variable parameter) may be used to represent a parameter having an IPv4 address format, YYYY-MM-DD may be used to represent a parameter having a date format, and ENUMNAME may be used to represent an interface number.
Usually, when defining a command, a developer will also define prompt information corresponding to the command parameters constituting the command. The prompt message can be used for explaining the meaning of the command parameter corresponding to the prompt message to the user.
When the command parameter corresponding to the prompt information is a fixed command parameter (the prompt information corresponding to the fixed command parameter is usually information that is not frequently modified), the prompt information may be defined in the description information (attribute information) corresponding to the fixed command parameter; when the command parameter is a variable command parameter, on one hand, when the prompt message is a prompt message that does not need to be modified frequently, the prompt message may be defined in the description information (attribute information) corresponding to the variable command parameter; on the other hand, when the prompt message is a prompt message that needs to be modified frequently (when the service requirement is increased, the prompt message is also changed accordingly), the variable command parameter and the corresponding prompt message may be defined in the configuration file corresponding to the command. In one embodiment, the configuration file may be a help function defined by a developer for ease of interpreting commands.
The following describes steps of a user querying for commands based on a command line interface (system commands are already maintained in the system, and reference to system commands in this application includes commands defined by developers, as well as commands included by the system itself).
When a user needs to query a command through the command line interface, the user may first input "command keyword a? "is used.
When the system operating the command line interface receives the query instruction, the system can screen out the commands comprising the command parameters A from the database, and display the next command parameter adjacent to the command keyword A and the corresponding prompt information in the commands meeting the conditions.
The user can continue to input "command keyword B? "a query instruction; the command keyword B is input by a user based on the displayed content, and the command keyword B includes the command keyword a and a next command parameter adjacent to the command keyword a.
When the system receives the query command continuously input by the user, the system can screen out the command comprising the command parameter B from the database, and display the next command parameter adjacent to the command keyword B and the corresponding prompt information in the command meeting the condition.
The user can repeatedly input the query instruction based on the display content until the self-required command is obtained.
It should be noted that, when the prompt information corresponding to the command parameter is obtained in the above step, the system may first determine whether the command parameter is a variable command parameter; if not, directly taking the description information corresponding to the command parameter as the prompt information of the command parameter; if so, matching the command parameter with the variable command parameter in the configuration file corresponding to the command, and if the command parameter is matched with any variable command parameter, taking the prompt information corresponding to the variable command parameter in the configuration file in the matching process as the prompt information corresponding to the command parameter.
For example, assume that the command that the user needs to query is "Enable interface ENUMNAME" (the command is maintained in the system). The command comprises 4 command parameters; wherein, the 'Enable' and 'interface' are fixed command parameters; "ENUMNAME" is a variable command parameter. The description information corresponding to "Enable" is "Enable interface" and the description information corresponding to interface "is null, and the correspondence between the variable command parameters and the prompt information in the configuration file corresponding to the command is shown in table 1.
Variable command parameters Prompt information
ENUMNAME input 1-16
TABLE 1
When the user inputs "Enable? When the command is queried, the system can screen out a command ("Enable interface ENUMNAME") including a command parameter "Enable" by querying the database, and display the next command parameter (in this example, the command parameter is "interface") adjacent to the "Enable" and prompt information corresponding to the command parameter ("interface") in the eligible commands.
When the prompt message corresponding to the interface is obtained, because the interface is not a variable command parameter, the description message corresponding to the command parameter (if the description message corresponding to the fixed command parameter is empty, the prompt message corresponding to the fixed command parameter may not be displayed) may be directly used as the prompt message of the command parameter.
Thereafter, the user can continue to enter "Enable interface? "is used. When the system receives the query instruction, the database may include a command with a command parameter "Enable", and display a next command parameter (in this example, the command parameter is "ENUMNAME") adjacent to the interface among the commands that meet the condition, and prompt information corresponding to the command parameter ("ENUMNAME").
When the prompt information corresponding to "ENUMNAME" is acquired, since "ENUMNAME" is a variable command parameter, the command parameter is matched with the variable command parameter in the configuration file (as shown in table 1) corresponding to the command. In this example, "ENUMNAME" can match the variable command parameter "ENUMNAME" in the configuration file, and thus "input 1-16" can be used as the prompt information corresponding to the command parameter "ENUMNAME".
Thus, the user acquires the complete command "Enable interface ENUMNAME".
Therefore, through the steps, the user can obtain the command required by the user.
However, on the one hand, assume that the command that the user needs to query is "replace ip a.b.c.d with a.b.c.d" (the command is already maintained in the system). The command comprises 5 command parameters; wherein, the "place", "ip" and "with" are fixed command parameters; "a.b.c.d" is a variable command parameter. The description information corresponding to the place is place A with B; the description information corresponding to the 'ip' is 'ip address'; the description information corresponding to "with" is empty. The correspondence between the variable command parameters and the prompt information in the configuration file corresponding to the command "place ip a.b.c.d with a.b.c.d" is shown in table 2.
Variable command parameters Prompt information
A.B.C.D input 192.168.1.1
A.B.C.D input 1.1.1.1
TABLE 2
When the user inputs "place ip? After the query instruction, the system needs to acquire the prompt information corresponding to the "a.b.c.d". Since "a.b.c.d" is a variable command parameter, the system needs to match "a.b.c.d" with a variable command parameter in a configuration file corresponding to the command, and if the command parameter matches any variable command parameter, take the prompt information corresponding to the matched variable command parameter in the configuration file as the prompt information corresponding to the command parameter. However, since the same variable command parameter "a.b.c.d" corresponds to different prompt information in the correspondence relationship shown in table 2, the system cannot determine which prompt information in the configuration file should be acquired as the prompt information corresponding to the variable command parameter "a.b.c.d".
On the other hand, since the variable command parameter is usually in the form of a character string, when the prompt information corresponding to the command parameter is determined by matching the variable command parameter in the configuration file corresponding to the command, the work efficiency is low.
Based on the above, the application provides a method for outputting command parameter prompt information based on a command line interface, which can be applied to an operating system. The method can mark the same command parameter in the command by using different command parameter identifications, so that the prompt message uniquely corresponding to the command parameter can be determined in the configuration file by the command parameter identification.
In implementation, please refer to fig. 1, where fig. 1 is a flowchart of a method for outputting command parameter prompt information based on a command line interface according to the present application. The method can be applied to an operating system, and command parameters included in system commands for system maintenance are respectively marked with command parameter identifiers; wherein, the same command parameters included in the system commands are respectively marked with different command parameter identifications; as shown in fig. 1, the method includes:
s101, acquiring a command keyword input by a user on the command line interface;
s102, responding to the command keyword, and determining a target system command of the system command maintained by the system, wherein the target system command comprises the command keyword;
s103, matching the command parameter identification marked by the target command parameter corresponding to the command keyword in the target system command with the prompt information identification in the configuration file corresponding to the target system command;
and S104, outputting the prompt information corresponding to the matched prompt information identifier as the prompt information of the target command parameter.
According to the scheme, the command parameter identifications are respectively marked due to the command parameters included in the system commands for system maintenance; when the prompt information corresponding to the target command parameter is obtained through the configuration file, the command parameter identifier marked by the command parameter is matched with the prompt information identifier in the configuration file, and the prompt information corresponding to the matched prompt information identifier is output as the prompt information of the target command parameter, so that the prompt information corresponding to the command parameter in the configuration file can be definitely determined, and the situation that the prompt information corresponding to the command parameter in the configuration file cannot be determined is avoided.
This embodiment will be described below with reference to specific examples.
Referring to fig. 2, fig. 2 is a structural diagram of an operating system according to the present application. As shown in FIG. 2, the operating system may include a command line page module 210, a hints information determination module 220 coupled to the command line page module 210, and a command set module 230 coupled to the hints information determination module 220. The functions of the modules may be crossed, and are not limited herein.
The command line page module 210 may be configured to receive command keyword information input by a user, and display command parameter prompt information corresponding to the command keyword. For example, a user may enter "command parameters? ".
The prompt information determining module 220 may be configured to determine a command parameter to be prompted according to the command received by the command line page module 210, and prompt information corresponding to the command parameter.
The command set module 230 may store commands defined in the operating system and commands carried by the operating system.
Here, it is necessary to describe a procedure of defining a command and defining prompt information corresponding to command parameters constituting the command in the present embodiment. The prompt information may be used to interpret the corresponding command parameter.
When defining a command, the command parameters included in the command can be marked with command parameter identifications respectively; wherein, the same command parameters included in the system command are respectively marked with different command parameters. In an embodiment, in order to improve the work efficiency of determining the prompt information corresponding to the command parameter by matching the prompt information identifier in the configuration file, a character may be used as the command parameter identifier.
For example, assume that when defining a command of "replace ip a.b.c.d with a.b.c.d", a character "0" may be selected to correspond to "replace", a character "1" may correspond to "ip", a character "i" may correspond to a previous command parameter "a.b.c.d", a character "3" may correspond to "with", and a character "j" may correspond to a next "a.b.c.d". In an embodiment, the identifiers may form an identifier set, and the identifiers in the identifier set may be global variables. In the above situation, the "place ip a.b.c.d with a.b.c.d" command may correspond to an identification set {0, 1, 'i', 3, 'j' } composed of global variable identifications, and command parameters in the command correspond to elements in the identification set one to one. The characters corresponding to the command parameters in the command may be any characters, and the same command parameter in the same command needs to correspond to different characters.
After the command definition is completed, prompt information corresponding to command parameters forming the command can be defined. The prompt message can be used for explaining the meaning of the command parameter corresponding to the prompt message to the user.
When defining the prompt information corresponding to the command parameters constituting the command, it may be determined whether the prompt information corresponding to the command parameters constituting the command needs to be modified frequently.
When the prompt information of the command parameter does not need to be modified frequently, the prompt information corresponding to the command parameter can be defined in the description information (attribute information) corresponding to the command parameter;
when the prompt information of the command parameter needs to be modified frequently, the prompt information corresponding to the command parameter can be defined in the configuration file corresponding to the command. Specifically, a command parameter identifier corresponding to the command parameter may be used as a prompt information identifier, and corresponds to the prompt information of the command parameter; then, the prompt message identifier and the prompt message of the command parameter are defined in the configuration file.
For example, assume that a command "place ip a.b.c.d with a.b.c.d" has been defined; the command corresponds to a flag set of {0, 1, 'i', 3, 'j' }. In the above command, the prompt information corresponding to "place" is "place a with B"; the prompt message corresponding to the 'ip' is 'ip address'; the prompt message corresponding to the "with" is empty; the prompt information corresponding to the former "a.b.c.d" is "input 192.168.1.1", and the prompt information corresponding to the latter "a.b.c.d" is "input 1.1.1.1"; the prompt messages of the "place", "ip" and "with" are prompt messages which do not need to be modified frequently; the hint information of "a.b.c.d" is hint information that needs to be modified often.
When defining the prompt information corresponding to the command parameters constituting the command, the prompt information of "place", "ip", and "with" may be defined in the description information corresponding to each of the command parameters, respectively; the previous prompt message "input 192.168.1.1" of "a.b.c.d" may correspond to the prompt message identifier "i" and be defined in the configuration file corresponding to the command, and the next prompt message "input 1.1.1.1" of "a.b.c.d" may correspond to the prompt message identifier "j" and be defined in the configuration file corresponding to the command. The corresponding relationship between the prompt information identifier and the prompt information in the configuration file may be as shown in table 3.
Prompt message identification Prompt information
i 192.168.1.1
j 1.1.1.1
TABLE 3
The following steps for a user to query for commands based on the command line interface.
Specifically, when the user needs to view the prompt information through the command line interface, the user can input "command keyword a? ". For example, a user may enter "replace" through the command line page module 210 described above? ".
At this time, the prompt information determining module 220 may execute S101, acquire a command keyword a input by the user on the command line interface, and then determine, in response to the command keyword a, a target system command including the command keyword a in the system commands maintained by the system.
In implementation, after the completion of the execution of S101, the prompt information determination module 220 may access the command set module 230 to obtain the command including the command keyword a from the commands stored in the command set module. For example, a user enters "place? After that, the prompt information determining module 220 may obtain a "replace ip a.b.c.d with a.b.c.d" command.
The hint information determination module 220 may then determine a target command parameter corresponding to the command key a in the target system command. In an embodiment, the target command parameter corresponding to the command keyword a in the target system command is a next command parameter adjacent to the command keyword a in the target system command.
After determining the target command parameter, matching the command parameter identifier marked by the target command parameter with the prompt information identifier in the configuration file corresponding to the target system command;
if the target command parameter is marked by the command parameter identifier and matches any prompt message identifier in the configuration file, outputting the prompt message corresponding to the matched prompt message identifier as the prompt message of the target command parameter;
and if the target command parameter is marked by the command parameter identifier and is not matched with any prompt information identifier in the configuration file, outputting the description information corresponding to the target command parameter as the prompt information of the target command parameter.
After determining the prompt information, the prompt information determining module 220 may output the prompt information to the command line interface module 210 to display the prompt information.
After the user sees the display information, the user can continue to input "command keyword B? "is a query instruction; the command keyword B is input by a user based on the displayed content, and the command keyword B includes the command keyword a and a next command parameter adjacent to the command keyword a. After the user inputs the query instruction, the command line page module 210, the prompt information determination module 220, and the command set module 230 may perform the foregoing steps in a coordinated manner until new prompt content is displayed, and the user may repeatedly input the query instruction based on the new prompt content until a command required by the user is obtained. Therefore, the user can obtain the command which needs to be inquired.
For example, assume that the command "replace ip a.b.c.d with a.b.c.d" has been maintained in the system; the identification set corresponding to the command is {0, 1, 'i', 3, 'j' }; in the above command, the description information corresponding to "place" is "place a with B"; the description information corresponding to the 'ip' is 'ip address'; the description information corresponding to "with" is null; the corresponding relationship between the prompt information identifier and the prompt information in the configuration file corresponding to the command is shown in table 3.
In the above situation, the user inputs "place? After that, the prompt information determining module 220 may obtain a "replace ip a.b.c.d with a.b.c.d" command. Then, the prompt information determining module 220 may determine that the target command parameter is "ip", and match a character "1" corresponding to "ip" with the prompt information identifier in the configuration file; since the hint information identifier in table 3 does not have the character "1", the hint information corresponding to "ip" is the description information "ip address" of the command parameter. After determining the prompt information, the prompt information determining module 220 may output the prompt information to the command line interface module 210 to display the prompt information. At this time, the user will see the prompt contents of "ip" and "ip address".
After obtaining the prompt content, the user can continue to input "replace ip? ". When the prompt information corresponding to the previous "a.b.c.d" needs to be acquired (the previous steps are not described in detail), since the command parameter identifier "i" corresponding to the "a.b.c.d" matches with the prompt information identifier "i" in the configuration file corresponding to the command, "input 192.168.1.1" will be prompted as the prompt information of the previous command parameter "a.b.c.d". At this time, the user will see the prompt contents of "a.b.c.d", "input 192.168.1.1".
After that, the user may repeatedly input the query instruction based on the new prompt content, and when determining the prompt information corresponding to the next "a.b.c.d" (the previous steps are not described in detail), since the command parameter identifier "i" corresponding to the "a.b.c.d" matches with the prompt information identifier "j" in the configuration file corresponding to the command, "input 1.1.1.1" will be prompted as the prompt information of the next command parameter "a.b.c.d". At this time, the user will see the prompt contents of "a.b.c.d", "input 1.1.1.1".
Until the command 'place ip A.B.C.D with A.B.C.D' required by the user is obtained.
Here, it should be noted that, when using the above commands, the user can input "place ip 192.168.1.1with 1.1.1.1" in the command line interface to input valid commands.
According to the scheme, on one hand, the command parameter identifications are marked respectively due to the command parameters included in the system commands for system maintenance; when the prompt information corresponding to the target command parameter is obtained through the configuration file, the command parameter identifier marked by the command parameter is matched with the prompt information identifier in the configuration file, and the prompt information corresponding to the matched prompt information identifier is output as the prompt information of the target command parameter, so that the prompt information corresponding to the command parameter in the configuration file can be definitely determined, and the situation that the prompt information corresponding to the command parameter in the configuration file cannot be determined is avoided.
On the other hand, because the command parameter identifier and the prompt message identifier may be characters, the work efficiency may be greatly improved when determining the prompt message corresponding to the command parameter through the configuration file corresponding to the command and the configuration file corresponding to the command.
In an embodiment, the command parameter identifier may indicate that the command parameter identifier corresponds to a command parameter at a position in the command including the command parameter. By distinguishing the same command parameter by using different position identifiers, the prompt message uniquely corresponding to the command parameter can be determined by the command parameter identifier.
In an embodiment, in order to make the method provided by the present application compatible, the prompt information for obtaining the target command parameter may be compatible with the existing related technologies, after S101-S102 is completed, it may be determined whether the identifier set corresponding to the command is an empty set, and if not, the steps of S101-S104 are performed; if it is an empty set, the existing correlation technique is performed.
In an embodiment, a specific flag may be preset, and after the execution of S101 to S102 is completed, it may be determined whether a command parameter flag indicating a target command parameter corresponding to the command keyword in the target system command is the specific flag.
If the command parameter identification marked by the target command parameter is not the specific identification, executing S103-S104;
matching the command parameter identification marked by the target command parameter corresponding to the command keyword in the target system command with the prompt information identification in the configuration file corresponding to the target system command;
if the command parameter mark marked by the target command parameter is the specific mark, the description information corresponding to the target command parameter is output as the prompt information of the target command parameter.
As can be seen from the above steps, when the command parameter identifier marked by the target command parameter is the specific identifier, the steps S103-S104 do not need to be executed, and the description information corresponding to the target command parameter is acquired as a prompt to you, so that the efficiency of acquiring the prompt information corresponding to the command parameter can be effectively improved.
Corresponding to the above method embodiment, the present application further provides a device for outputting prompt information based on a command line interface, which is applied to an operating system, and command parameters included in system commands maintained by the system are respectively marked with command parameter identifiers; wherein, the same command parameters included in the system command are respectively marked with different command parameter identifications. Referring to fig. 3, fig. 3 is a structural diagram of an apparatus for outputting command parameter prompt information based on a command line interface according to the present application.
As shown in fig. 3, the apparatus 300 includes:
an obtaining module 310, configured to obtain a command keyword input by a user on the command line interface;
a determining module 320, configured to determine, in response to the command keyword, a target system command including the command keyword in a system command maintained by the system;
a matching module 330, configured to match a command parameter identifier, marked with a target command parameter corresponding to the command keyword, in the target system command with a prompt information identifier in a configuration file corresponding to the target system command;
and the output module 340 outputs the prompt information corresponding to the matched prompt information identifier as the prompt information of the target command parameter.
In an embodiment, the command parameter identifier and the prompt information identifier are character identifiers.
In an embodiment, the command parameter id indicates a position of the command parameter in the command including the command parameter corresponding to the command parameter id.
In an embodiment, the command parameters correspond to the description information one to one; the output module 340 is further configured to:
and if the target command parameter is marked by the command parameter identifier and is not matched with any prompt information identifier in the configuration file, outputting the description information corresponding to the target command parameter as the prompt information of the target command parameter.
In one embodiment shown, a particular identifier is maintained in the system; the above-mentioned device still includes:
a second determining module, configured to determine whether the command parameter identifier marked by the target command parameter is the specific identifier;
an execution module, configured to, if the command parameter identifier marked by the target command parameter is not the specific identifier, perform a step of matching the command parameter identifier marked by the target command parameter corresponding to the command keyword in the target system command with a prompt information identifier in a configuration file corresponding to the target system command;
if the command parameter mark marked by the target command parameter is the specific mark, the description information corresponding to the target command parameter is output as the prompt information of the target command parameter.
In an embodiment, a target command parameter corresponding to the command keyword in the target system command is a next command parameter adjacent to the command keyword in the target system command.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows described above can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Computers suitable for executing computer programs include, for example, general and/or special purpose microprocessors, or any other type of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory and/or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer does not necessarily have such a device. Moreover, a computer may be embedded in another device, e.g., a mobile telephone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., an internal hard disk or a removable disk), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only a preferred embodiment of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for outputting command parameter prompt information based on a command line interface is characterized in that command parameters included in system commands maintained by a system are respectively marked with command parameter identifications; wherein, the same command parameters included in the system command are respectively marked with different command parameter identifications; the method comprises the following steps:
acquiring a command keyword input by a user on the command line interface;
responding to the command keyword, and determining a target system command comprising the command keyword in system commands maintained by the system;
matching a command parameter identifier marked with a target command parameter corresponding to the command keyword in the target system command with a prompt information identifier in a configuration file corresponding to the target system command;
outputting the prompt information corresponding to the matched prompt information identification as the prompt information of the target command parameter;
and the target command parameter corresponding to the command keyword in the target system command is the next command parameter adjacent to the command keyword in the target system command.
2. The method of claim 1, wherein the command parameter identifier and the prompt information identifier are character identifiers.
3. The method of claim 1, wherein the command parameter identification indicates a position of the command parameter in the command including the command parameter corresponding to the command parameter identification.
4. The method of claim 1, wherein the command parameters correspond to description information thereof one-to-one; the method further comprises the following steps:
if the target command parameter is marked by the command parameter identifier and is not matched with any prompt information identifier in the configuration file, outputting the description information corresponding to the target command parameter as the prompt information of the target command parameter.
5. The method of claim 4, wherein a specific identifier is maintained in the system; the method further comprises the following steps:
determining whether the command parameter identification of the target command parameter marked is the specific identification;
if the command parameter identification marked by the target command parameter is not the specific identification, executing the step of matching the command parameter identification marked by the target command parameter corresponding to the command keyword in the target system command with the prompt information identification in the configuration file corresponding to the target system command;
and if the command parameter identification marked by the target command parameter is the specific identification, outputting the description information corresponding to the target command parameter as prompt information of the target command parameter.
6. A device for outputting command parameter prompt information based on a command line interface is characterized in that command parameters included in system commands for system maintenance are respectively marked with command parameter identifications; wherein, the same command parameters included in the system command are respectively marked with different command parameter identifications; the device comprises:
the acquisition module is used for acquiring command keywords input by a user on the command line interface;
the determining module is used for responding to the command keyword and determining a target system command which comprises the command keyword in the system commands maintained by the system;
the matching module is used for matching the command parameter identifier marked by the target command parameter corresponding to the command keyword in the target system command with the prompt information identifier in the configuration file corresponding to the target system command; the target command parameter corresponding to the command keyword in the target system command is the next command parameter adjacent to the command keyword in the target system command;
and the output module is used for outputting the prompt information corresponding to the matched prompt information identifier as the prompt information of the target command parameter.
7. The apparatus of claim 6, wherein the command parameter identifier and the prompt information identifier are character identifiers.
8. The apparatus of claim 6, wherein the command parameter identifier indicates a position of the command parameter identifier corresponding to the command parameter in the command including the command parameter.
9. The apparatus of claim 6, wherein the command parameters correspond to description information thereof one to one; the output module is further configured to:
if the target command parameter is marked by the command parameter identifier and is not matched with any prompt information identifier in the configuration file, outputting the description information corresponding to the target command parameter as the prompt information of the target command parameter.
10. The apparatus of claim 9, wherein a specific identifier is maintained in the system; the device further comprises:
the second determination module is used for determining whether the command parameter identifier marked by the target command parameter is the specific identifier;
the execution module is used for matching the command parameter identifier marked with the target command parameter corresponding to the command keyword in the target system command with the prompt information identifier in the configuration file corresponding to the target system command if the command parameter identifier marked with the target command parameter is not the specific identifier;
and if the command parameter identification marked by the target command parameter is the specific identification, outputting the description information corresponding to the target command parameter as prompt information of the target command parameter.
CN201911165840.2A 2019-11-25 2019-11-25 Method and device for outputting prompt information based on command line interface Active CN111045766B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911165840.2A CN111045766B (en) 2019-11-25 2019-11-25 Method and device for outputting prompt information based on command line interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911165840.2A CN111045766B (en) 2019-11-25 2019-11-25 Method and device for outputting prompt information based on command line interface

Publications (2)

Publication Number Publication Date
CN111045766A CN111045766A (en) 2020-04-21
CN111045766B true CN111045766B (en) 2022-07-01

Family

ID=70234120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911165840.2A Active CN111045766B (en) 2019-11-25 2019-11-25 Method and device for outputting prompt information based on command line interface

Country Status (1)

Country Link
CN (1) CN111045766B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113922979B (en) * 2021-08-23 2023-07-04 北京天融信网络安全技术有限公司 Network security equipment configuration system, configuration method and computer equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1601969A (en) * 2003-09-24 2005-03-30 华为技术有限公司 Information analytical method for facility configuration
CN101478557A (en) * 2008-01-02 2009-07-08 中兴通讯股份有限公司 Automation system and terminal simulation method thereof
CN101546264A (en) * 2009-04-27 2009-09-30 成都市华为赛门铁克科技有限公司 command line processing method, device and communication system
CN102902547A (en) * 2012-10-18 2013-01-30 上海师范大学 Command construction and analysis method of command line interface
CN106293697A (en) * 2016-07-22 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of method and device realizing virsh order
CN107679203A (en) * 2017-10-12 2018-02-09 广州华多网络科技有限公司 A kind of Redis internal databases call method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050243066A1 (en) * 2004-04-28 2005-11-03 Adc Broadband Access Systems, Inc. Command line interface in a communication system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1601969A (en) * 2003-09-24 2005-03-30 华为技术有限公司 Information analytical method for facility configuration
CN101478557A (en) * 2008-01-02 2009-07-08 中兴通讯股份有限公司 Automation system and terminal simulation method thereof
CN101546264A (en) * 2009-04-27 2009-09-30 成都市华为赛门铁克科技有限公司 command line processing method, device and communication system
CN102902547A (en) * 2012-10-18 2013-01-30 上海师范大学 Command construction and analysis method of command line interface
CN106293697A (en) * 2016-07-22 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of method and device realizing virsh order
CN107679203A (en) * 2017-10-12 2018-02-09 广州华多网络科技有限公司 A kind of Redis internal databases call method and system

Also Published As

Publication number Publication date
CN111045766A (en) 2020-04-21

Similar Documents

Publication Publication Date Title
US11804053B2 (en) Image recognition method and terminal
CN107644002B (en) Article searching method, device and system
CN106095432B (en) Method for identifying application type
CN113364853B (en) Business service system, business request method and gateway equipment
CN104951456A (en) Method, device and equipment used for obtaining answer information
CN108170719A (en) A kind of search method, server and computer readable storage medium
CN109672608B (en) Method for transmitting messages according to time
US9684711B2 (en) System and method for providing agent service to user terminal
CN111045766B (en) Method and device for outputting prompt information based on command line interface
CN102710740A (en) Device identification using device functions
CN114387966A (en) Control method and device of intelligent equipment, electronic equipment and storage medium
CN110366025B (en) Configuration method of display content, intelligent terminal and computer readable storage medium
CN107330069B (en) Multimedia data processing method and device, server and storage medium
CN108897772B (en) Data source supplementing method and device, computer equipment and storage medium
CN110706035A (en) Updating effect evaluation method and device, storage medium and electronic equipment
CN102629208A (en) Method, device and equipment for determining system interface
CN104021173A (en) Method and device for providing hardware drive program
CN110737662B (en) Data analysis method, device, server and computer storage medium
CN104407846B (en) Information processing method and device
CN104424206A (en) Information processing method and education platform
CN105704686B (en) A kind of instant communication method based on short message, apparatus and system
CN112306009B (en) Control method and device of household appliance, electronic device and storage medium
CN106302728A (en) Household equipment long-range control method and device
WO2015196844A1 (en) Task assignment method, apparatus, system and server
CN108572948A (en) The processing method and processing device of doorplate information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant