mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
Take hints on port 1235, hint script in user's PATH
This commit is contained in:
parent
cf10605bf4
commit
d8d48c245e
5 changed files with 37 additions and 5 deletions
scripts
|
@ -10,7 +10,7 @@ $socket = IO::Socket::INET->new(PeerAddr => "127.0.0.1",
|
|||
|
||||
my $absolute_path = File::Spec->rel2abs($ARGV[0]);
|
||||
|
||||
# Send the length of the first argument as a byte.
|
||||
# Send the length of the first argument as four bytes.
|
||||
$socket->send(pack("L", length($absolute_path)));
|
||||
# Send the first argument as a string.
|
||||
$socket->send($absolute_path);
|
||||
|
|
15
scripts/hint
Executable file
15
scripts/hint
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use IO::Socket;
|
||||
|
||||
$socket = IO::Socket::INET->new(PeerAddr => "127.0.0.1",
|
||||
PeerPort => 1235,
|
||||
Proto => "tcp",
|
||||
Type => SOCK_STREAM);
|
||||
|
||||
my $message = join " ", @ARGV;
|
||||
|
||||
# Send the length of the first argument as four bytes.
|
||||
$socket->send(pack("L", length($message)));
|
||||
# Send the first argument as a string.
|
||||
$socket->send($message);
|
Loading…
Add table
Add a link
Reference in a new issue