From owner-freebsd-hackers Thu Aug 30 17:39:33 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from maxim.gbch.net (gw.gbch.net [203.24.22.66]) by hub.freebsd.org (Postfix) with SMTP id 3BD8237B405 for ; Thu, 30 Aug 2001 17:39:22 -0700 (PDT) (envelope-from gjb@gbch.net) Received: (qmail 57696 invoked by uid 1001); 31 Aug 2001 10:36:44 +1000 Message-ID: X-Posted-By: GJB-Post 2.21 16-Jun-2001 X-Operating-System: FreeBSD 4.2-RELEASE i386 X-Location: Brisbane, Australia; 27.49841S 152.98439E X-URL: http://www.gbch.net/gjb.html X-Image-URL: http://www.gbch.net/gjb/gjb-auug048.gif X-GPG-Fingerprint: EBB2 2A92 A79D 1533 AC00 3C46 5D83 B6FB 4B04 B7D6 X-PGP-Public-Keys: http://www.gbch.net/keys.html Date: Fri, 31 Aug 2001 10:36:44 +1000 From: Greg Black To: Leo Bicknell Cc: freebsd-hackers@freebsd.org Subject: Re: Should URL's be pervasive. References: <20010830111018.A97057@ussenterprise.ufp.org> In-reply-to: <20010830111018.A97057@ussenterprise.ufp.org> of Thu, 30 Aug 2001 11:10:18 -0400 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Leo Bicknell wrote: | I ran into a pair of all too common annoyances this morning that | got me thinking. Via the magic of cut and paste I ended up with | the following two sorts of command lines: | | mutt mailto:bicknell@ufp.org | traceroute http://www.ufp.org/ | | These of course come from the 'copy link location' available in | most browsers. When pasted into most Unix commands (with the | exception of fetch and lynx, of course) the result is something | that just doesn't work. This got me thinking, should all commands | know how to take an URL, and 'do the right thing'? Could this | be made easy by providing a standard URL parsing library that | all commands could use for parsing? Why not do it the Unix way? Create a new application, e.g., url(1), to parse the URLs and use it like so: mutt `url mailto:bicknell@ufp.org` --> mutt bicknell@ufp.org traceroute `url -h http://www.ufp.org/` --> traceroute www.ufp.org With no options, url would provide a "sane" default for the type of URL, e.g., "user@host.dom" for a mailto. Options then modify that; e.g., -u could extract the user part from a mailto; -h would give the host part of any URL; and so on. An alternate approach might be to have url exec the command once it had done its parsing: url mailto:bicknell@ufp.org mutt url -h http://www.ufp.org/ traceroute This way, we don't have to modify all those applications. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message