firecat53 / urlscan

Mutt and terminal url selector (similar to urlview)
GNU General Public License v2.0
214 stars 38 forks source link

question - how to display line number #103

Open cjbd opened 3 years ago

cjbd commented 3 years ago

hello, i'm new to urlscan, this tool is pretty cool, i'm using it to find all urls in source code, the output is great, but it would be even better to print line number along with url found, how can i do that? thank you!

$ urlscan -n /path/to/mycode.cc
crbug.com
http://crbug.com/898555)
https://security.googleblog.com/2017/09/chromes-plan-to-distrust-symantec.html
http://crbug.com/921750)
firecat53 commented 3 years ago

Nothing comes to mind immediately. I thought maybe some combination of --regex and --run, but I think urlscan would have to track the line numbers. This would take adding an option to list the urls by line number instead of just numerically. PR's welcome!

elig0n commented 1 day ago

@cjbd You can use nl from coreutils.

$ urlscan -n /path/to/mycode.cc | nl