9front - general discussion about 9front
 help / color / mirror / Atom feed
* Re: [9front] [PATCH] hget: file name detection
@ 2022-10-15 21:07 Alex Musolino
  2022-10-15 21:10 ` Alex Musolino
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Musolino @ 2022-10-15 21:07 UTC (permalink / raw)
  To: 9front



> I have tried some URLs with queries with them
> and haven't seen any which fails, why should they?

It’s not that they file but that file you write to disk has the query string in the name.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [9front] [PATCH] hget: file name detection
@ 2022-10-11 19:11 mkf9
  2022-10-11 20:39 ` Alex Musolino
  0 siblings, 1 reply; 14+ messages in thread
From: mkf9 @ 2022-10-11 19:11 UTC (permalink / raw)
  To: 9front

This patch adds basic file name detection mode in hget,
for example:
hget -a http://9front.org/img/nix-on.jpg
would be equal to
hget -o nix-on.jpg http://9front.org/img/nix-on.jpg

--- /bin/hget
+++ /bin/hget
@@ -2,7 +2,7 @@
  rfork e
  argv0=$0
  fn usage {
-	echo usage: $argv0 '[ -l | -o file] [ -p body | -P ] [ -r header ] [ 
-m method ] [ -b baseurl ] url' >[1=2]
+	echo usage: $argv0 '[ -l | -a | -o file] [ -p body | -P ] [ -r header 
] [ -m method ] [ -b baseurl ] url' >[1=2]
  	exit usage
  }
  s=0
@@ -34,6 +34,8 @@
  	case -b
  		b=$2
  		shift
+	case -a
+		o=`{basename $2}
  	case *
  		usage
  	}

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-10-16 21:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-15 21:07 [9front] [PATCH] hget: file name detection Alex Musolino
2022-10-15 21:10 ` Alex Musolino
2022-10-15 22:51   ` ori
2022-10-16 19:59     ` Alex Musolino
2022-10-16 21:53       ` ori
2022-10-16  6:00   ` mkf9
2022-10-16 20:02     ` Alex Musolino
2022-10-16 20:17       ` Stanley Lieber
  -- strict thread matches above, loose matches on Subject: below --
2022-10-11 19:11 mkf9
2022-10-11 20:39 ` Alex Musolino
2022-10-12  2:50   ` mkf9
2022-10-12  4:32     ` unobe
2022-10-12 11:31       ` umbraticus
2022-10-12 22:01       ` mkf9

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).