Skip to content

Commit c746f0b

Browse files
committed
trurl: the name of the tool
Renamed from the temp original name. Thanks everyone for your amazing proposals. Fixes curl#1 Closes curl#32
1 parent 9f08eae commit c746f0b

File tree

7 files changed

+41
-41
lines changed

7 files changed

+41
-41
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# compiled program
2-
/urler
2+
/trurl
33

44
# Prerequisites
55
*.d

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
TARGET = urler
2-
OBJS = urler.o
1+
TARGET = trurl
2+
OBJS = trurl.o
33
LDLIBS = -lcurl
44
CFLAGS := $(CFLAGS) -W -Wall -pedantic -g
5-
MANUAL = urler.1
5+
MANUAL = trurl.1
66

77
PREFIX ?= /usr/local
88
BINDIR ?= $(DESTDIR)$(PREFIX)/bin

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# urler
1+
# trurl
22

33
command line tool for URL parsing and manipulation
44

@@ -7,28 +7,28 @@ command line tool for URL parsing and manipulation
77
## Example command lines
88

99
~~~
10-
$ urler --url https://curl.se --set host=example.com
10+
$ trurl --url https://curl.se --set host=example.com
1111
https://example.com/
1212
13-
$ urler --set host=example.com --set scheme=ftp
13+
$ trurl --set host=example.com --set scheme=ftp
1414
ftp://example.com/
1515
16-
$ urler --url https://curl.se/we/are.html --redirect here.html
16+
$ trurl --url https://curl.se/we/are.html --redirect here.html
1717
https://curl.se/we/here.html
1818
19-
$ urler --url https://curl.se/we/../are.html --set port=8080
19+
$ trurl --url https://curl.se/we/../are.html --set port=8080
2020
https://curl.se:8080/are.html
2121
22-
$ urler --url https://curl.se/we/are.html --get '{path}'
22+
$ trurl --url https://curl.se/we/are.html --get '{path}'
2323
/we/are.html
2424
25-
$ urler --url https://curl.se/we/are.html --get '{port}'
25+
$ trurl --url https://curl.se/we/are.html --get '{port}'
2626
443
2727
28-
$ urler --url https://curl.se/hello --append path=you
28+
$ trurl --url https://curl.se/hello --append path=you
2929
https://curl.se/hello/you
3030
31-
$ urler --url "https://curl.se?name=hello" --append query=search=string
31+
$ trurl --url "https://curl.se?name=hello" --append query=search=string
3232
https://curl.se/?name=hello&search=string
3333
~~~
3434

@@ -40,8 +40,8 @@ It's quite easy to compile the C source with GCC :
4040

4141
```
4242
$ make
43-
cc -W -Wall -pedantic -g -c -o urler.o urler.c
44-
cc urler.o -lcurl -o urler
43+
cc -W -Wall -pedantic -g -c -o trurl.o trurl.c
44+
cc trurl.o -lcurl -o trurl
4545
```
4646

4747
Note that development files of libcurl (e.g. `libcurl4-openssl-dev` or `libcurl4-gnutls-dev`) are

test.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
for my $c (@t) {
2626
my ($i, $o) = split(/\|/, $c);
2727
# A future version should also check stderr
28-
my @out = `./urler $i 2>/dev/null`;
28+
my @out = `./trurl $i 2>/dev/null`;
2929
my $result = join("", @out);
3030
chomp $result;
3131
if($result ne $o) {

urler.1 renamed to trurl.1

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.\" You can view this file with:
2-
.\" man -l urler.1
2+
.\" man -l trurl.1
33
.\" Written by Daniel Stenberg
44
.\"
5-
.TH urler 1 "31 Mar 2023" "urler 0.1" "urler Manual"
5+
.TH trurl 1 "31 Mar 2023" "trurl 0.1" "trurl Manual"
66
.SH NAME
7-
urler \- parse and manipulate URLs
7+
trurl \- transpose URLs
88
.SH SYNOPSIS
9-
.B urler [options]
9+
.B trurl [options]
1010
.SH DESCRIPTION
11-
.B urler
11+
.B trurl
1212
parses, manipulates and outputs URLs and parts of URLs.
1313

1414
It uses the RFC 3986 definition of URLs and it uses libcurl's URL parser to do
@@ -23,13 +23,13 @@ Show version information and exit.
2323
.SH "INPUT OPTIONS"
2424
.IP "--url [URL]"
2525
Set the input URL to work with. The URL may be provided without a scheme,
26-
which then typically is not actually a legal URL but urler will try to figure
26+
which then typically is not actually a legal URL but trurl will try to figure
2727
out what is meant and guess what scheme to use.
2828

29-
Providing multiple URLs will make urler act on all URLs in a serial fashion.
29+
Providing multiple URLs will make trurl act on all URLs in a serial fashion.
3030
.IP "--url-file [name]"
3131
Read URLs to work on from the given file. Use the file name "-" (a single
32-
minus) to tell urler to read the URLs from stdin.
32+
minus) to tell trurl to read the URLs from stdin.
3333

3434
Each line needs to be a single valid URL and the line needs to end with a
3535
newline. The maximum URL length supported in a file like this is 4095 bytes.
@@ -62,52 +62,52 @@ within curly braces. The following component names are available: {url},
6262
.SH "MODIFIERS"
6363
.IP "--urldecode"
6464
By default each component is output using the format of the input (URL
65-
encoded). This option makes urler instead provide it URL decoded. Note that
65+
encoded). This option makes trurl instead provide it URL decoded. Note that
6666
%20 will then output space and %09 a tab etc.
6767
.SH EXAMPLES
6868
.IP "Replace the host name of a URL"
6969
.nf
70-
$ urler --url https://curl.se --set host=example.com
70+
$ trurl --url https://curl.se --set host=example.com
7171
https://example.com/
7272
.fi
7373
.IP "Create a URL by setting components"
7474
.nf
75-
$ urler --set host=example.com --set scheme=ftp
75+
$ trurl --set host=example.com --set scheme=ftp
7676
ftp://example.com/
7777
.fi
7878
.IP "Redirect a URL"
7979
.nf
80-
$ urler --url https://curl.se/we/are.html --redirect here.html
80+
$ trurl --url https://curl.se/we/are.html --redirect here.html
8181
https://curl.se/we/here.html
8282
.fi
8383
.IP "Change port number"
84-
This also shows how urler will remove dot-dot sequences
84+
This also shows how trurl will remove dot-dot sequences
8585

8686
.nf
87-
$ urler --url https://curl.se/we/../are.html --set port=8080
87+
$ trurl --url https://curl.se/we/../are.html --set port=8080
8888
https://curl.se:8080/are.html
8989
.IP "Extract the path from a URL"
9090
.nf
91-
$ urler --url https://curl.se/we/are.html --get '{path}'
91+
$ trurl --url https://curl.se/we/are.html --get '{path}'
9292
/we/are.html
9393
.IP "Extract the port from a URL"
9494
This gets the default port based on the scheme if the port is not set in the
9595
URL.
9696

9797
.nf
98-
$ urler --url https://curl.se/we/are.html --get '{port}'
98+
$ trurl --url https://curl.se/we/are.html --get '{port}'
9999
443
100100
.IP "Append a path segment to a URL"
101101
.nf
102-
$ urler --url https://curl.se/hello --append path=you
102+
$ trurl --url https://curl.se/hello --append path=you
103103
https://curl.se/hello/you
104104
.IP "Append a query segment to a URL"
105105
.nf
106-
$ urler --url "https://curl.se?name=hello" --append query=search=string
106+
$ trurl --url "https://curl.se?name=hello" --append query=search=string
107107
https://curl.se/?name=hello&search=string
108108
.IP "Read URLs from stdin"
109109
.nf
110-
$ cat urllist.txt | urler --url-file -
110+
$ cat urllist.txt | trurl --url-file -
111111
...
112112
.SH WWW
113-
https://github.com/curl/urler
113+
https://github.com/curl/trurl

urler.c renamed to trurl.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define OUTPUT_QUERY 8
4343
#define OUTPUT_FRAGMENT 9
4444
#define OUTPUT_ZONEID 10
45-
#define PROGNAME "urler"
45+
#define PROGNAME "trurl"
4646

4747
static void help(const char *msg)
4848
{
@@ -68,7 +68,7 @@ static void help(const char *msg)
6868
static void show_version(void)
6969
{
7070
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
71-
fprintf(stdout, "%s version %s libcurl/%s\n", PROGNAME, URLER_VERSION_TXT, data->version);
71+
fprintf(stdout, "%s version %s libcurl/%s\n", PROGNAME, TRURL_VERSION_TXT, data->version);
7272
exit(0);
7373
}
7474

version.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef URLER_VERSION_H
2-
#define URLER_VERSION_H
1+
#ifndef TRURL_VERSION_H
2+
#define TRURL_VERSION_H
33
/***************************************************************************
44
* _ _ ____ _
55
* Project ___| | | | _ \| |
@@ -22,6 +22,6 @@
2222
*
2323
***************************************************************************/
2424

25-
#define URLER_VERSION_TXT "0.1"
25+
#define TRURL_VERSION_TXT "0.1"
2626

2727
#endif

0 commit comments

Comments
 (0)