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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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 ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com