File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ def main(argv:List[str]=sys.argv[1:]) -> int:
7575 help = 'get information of snippet by index ID' )
7676 getparser .add_argument ('--file' , '-f' , action = 'store_true' ,
7777 help = 'get source file path of snippet' )
78+ getparser .add_argument ('--line-start' , action = 'store_true' ,
79+ help = 'get line number where snippet starts in source file' )
80+ getparser .add_argument ('--line-end' , action = 'store_true' ,
81+ help = 'get line number where snippet ends in source file' )
7882 getparser .add_argument ('--text' , '-t' , action = 'store_true' ,
7983 help = 'get source reStructuredText of snippet' )
8084 getparser .add_argument ('--url' , '-u' , action = 'store_true' ,
@@ -159,6 +163,10 @@ def _on_command_get(args:argparse.Namespace):
159163 if item .snippet .refid ():
160164 url += '#' + item .snippet .refid ()
161165 print (url )
166+ if args .line_start :
167+ print (item .snippet .scope ()[0 ])
168+ if args .line_end :
169+ print (item .snippet .scope ()[1 ])
162170
163171
164172def _on_command_integration (args :argparse .Namespace ):
You can’t perform that action at this time.
0 commit comments