[Surfraw-devel] surfraw -- errors to stderr, bookmark handling

Stephen Blott smblott at gmail.com
Sun Apr 3 15:01:30 UTC 2011


I'm a long time surfraw user.  Many thanks to all who have contributed,
it's a great tool.

But I do have two tiny little issues:

1. Currently:

      $ surfraw any old garbage

   produces a non-zero exit code (which is good) and a usage message on
   standard output (which is bad).  Surely error messages should go to
   standard error.

2. Currently, a surfraw bookmark:

      bbc http://news.bbc.co.uk

   is returned by:

      $ surfraw -print b
      $ surfraw -print c
      $ surfraw -print bb
      $ surfraw -print bc
      $ surfraw -print bbc

   Surely only the last should match?

   Worse still, even:

      $ surfraw bb king

   matches the BBC bookmark.

   The offending line is:

      nawk -v search="$search" '$1 ~ search { print $2; }'  $file | head -n 1

   which seems somewhat too liberal to me.

   Why does this matter?  Because I'm trying to integrate surfraw with
   some other tools.  So I want it to fail, and fail right, if there
   isn't a real match.

Are these considered bugs or features?

Would anybody be willing/able to fix them?


More information about the Surfraw-devel mailing list