shithub: riscv

Download patch

ref: 91ce0a07ca23fc68a1b60c77f2127481d37ad458
parent: 5e2478ccbb7927256f72cb749cf1a8d97dbbd4e9
author: cinap_lenrek <[email protected]>
date: Fri Sep 20 13:39:33 EDT 2013

hpost: dont emit /bin/hpost but just hpost

just emiting "hpost" makes it simpler to override it as a
rc function.

--- a/rc/bin/hpost
+++ b/rc/bin/hpost
@@ -1,6 +1,5 @@
 #!/bin/rc
 rfork e
-argv0=$0
 url=()
 at=()	# text fields
 af=()	# file fields
@@ -7,7 +6,7 @@
 l=()
 
 fn usage {
-	echo usage: $argv0 '[ -l ] [ -[gpm] action ] [ -u ] url [ field:value | field@file ... ]' >[1=2]
+	echo 'usage: hpost [ -l ] [ -[gpm] action ] [ -u ] url [ field:value | field@file ... ]' >[1=2]
 	exit usage
 }
 
@@ -41,7 +40,7 @@
 	shift
 }
 
-hpost=($argv0 $l)
+hpost=(hpost $l)
 
 fn uenc {
 	f=$1
--- a/sys/man/1/hget
+++ b/sys/man/1/hget
@@ -204,7 +204,7 @@
 .IP
 .EX
 % hpost http://p.intma.in
-/bin/hpost -u http://p.intma.in -p paste.cgi text:
+hpost -u http://p.intma.in -p paste.cgi text:
 .EE
 .PP
 Manually specify fields to be sent to a given