Aspects of the disclosure provide for mechanisms for automatic generating synopsis data of command-line commands. A method of the disclosure includes processing source code implementing a command; identifying, in view of the processing, a plurality of command options related to the command; generating, by a processing device, relationship data representing dependencies of the command options; and generating, by the processing device, synopsis data for the command in view of the relationship data. In some embodiments, the relationship data may include a graph, wherein the graph including an arc that associates a first node of the graph with a second node of the graph. The first node may correspond to the first command option. The second node may correspond to the second command option.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method, comprising: processing source code implementing a command, wherein processing the source code comprises performing introspection on the source code; identifying, in view of the processing, a plurality of command options related to the command, wherein each of the plurality of command options comprises a corresponding parameter to modify execution of the command; generating, by a processing device, relationship data representing dependencies of the command options; and generating, by the processing device, synopsis data for the command in view of the relationship data, wherein generating the synopsis data comprises identifying, in view of the relationship data, a first command option of the plurality of command options, and generating a first synopsis element corresponding to the first command option.
2. The method of claim 1 , wherein processing the source code further comprises identifying a plurality of annotations, and wherein each of the plurality of annotations references an attribute of a corresponding command option of the plurality of command options.
3. The method of claim 1 , wherein generating the synopsis data further comprises: identifying, in view of the relationship data, a second command option that depends on the first command option; and generating a second synopsis element corresponding to the second command option.
4. The method of claim 3 , wherein the relationship data comprises a graph, wherein the graph comprises an arc that associates a first node of the graph with a second node of the graph, wherein the first node corresponds to the first command option, and wherein the second node corresponds to the second command option.
5. The method of claim 3 , wherein generating the synopsis data further comprises: identifying, in view of the relationship data, a third command option that conflicts with the first command option; and generating a third synopsis element corresponding to the third command option.
6. The method of claim 5 , wherein generating the synopsis data further comprises: identifying, in view of the relationship data, a fourth command option that depends on the first command option and the third command option; and generating a fourth synopsis element corresponding to the fourth command option.
7. The method of claim 5 , wherein generating the synopsis data further comprises: determining, in view of the relationship data, that the third command option depends on a fifth command option; and generating a fifth synopsis element corresponding to the fifth command option.
8. The method of claim 1 , further comprising: determining an execution context related to at least one of the plurality of command options, wherein the synopsis data is further generated in view of the execution context.
9. A system, comprising: a memory; and a processing device, communicably coupled to the memory, to: process source code implementing a command, wherein to process the source code, the processing device is to perform introspection on the source code; identify, in view of the processing, a plurality of command options related to the command, wherein each of the plurality of command options comprises a corresponding parameter to modify execution of the command; generate relationship data representing dependencies of the plurality of command options; and generate synopsis data for the command in view of the relationship data,wherein to generate the synopsis data, the processing device is to identify, in view of the relationship data, a first command option of the plurality of command options, and generate a first synopsis element corresponding to the first command option.
10. The system of claim 9 , wherein, to process the source code, the processing device is further to identify a plurality of annotations, and wherein each of the plurality of annotations references an attribute of a corresponding command option of the plurality of command options.
11. The system of claim 9 , wherein, to generate the synopsis data, the processing device is further to: identify, in view of the relationship data, a second command option that depends on the first command option; and generate a second synopsis element corresponding to the second command option.
12. The system of claim 11 , wherein the relationship data comprises a graph, wherein the graph comprises an arc that associates a first node of the graph with a second node of the graph, and wherein the first node corresponds to the first command option and the second node corresponds to the second command option.
13. The system of claim 11 , wherein, to generate the synopsis data, the processing device is further to: identify, in view of the relationship data, a third command option that conflicts with the first command option; and generate a third synopsis element corresponding to the third command option.
14. The system of claim 13 , wherein, to generate the synopsis data, the processing device is further to: identify, in view of the relationship data, a fourth command option that depends on the first command option and the third command option; and generate a fourth synopsis element corresponding to the fourth command option.
15. The system of claim 13 , wherein to generate the synopsis data, the processing device is further to: identify, in view of the relationship data, that the third command option depends on a fifth command option; and generate a fifth synopsis element corresponding to the fifth command option.
16. A non-transitory machine-readable storage medium including instructions that, when accessed by a processing device, cause the processing device to: process source code implementing a command, wherein to process the source code, the processing device is to perform introspection on the source code; identify, in view of the processing, a plurality of command options related to the command, wherein each of the plurality of command options comprises a corresponding parameter to modify execution of the command; generate relationship data representing dependencies of the plurality of command options; and generate synopsis data for the command in view of the relationship data, wherein to generate the synopsis data, the processing device is to identify, in view of the relationship data, a first command option of the plurality of command options, and generate a first synopsis element corresponding to the first command option.
17. The non-transitory machine-readable storage medium of claim 16 , wherein to process the source code, the processing device is further to identify a plurality of annotations, and wherein each of the plurality of annotations references an attribute of a corresponding command option of the plurality of command options.
18. The non-transitory machine-readable storage medium of claim 16 , wherein to generate the synopsis data, the processing device is further to : identify, in view of the relationship data, a second command option that depends on the first command option; and generate a second synopsis element corresponding to the second command option.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
September 29, 2017
April 28, 2020
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.