Skip to content

Commit 77b4425

Browse files
committed
all: document import from file
1 parent 68a9b5b commit 77b4425

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,26 @@ The current approach is to use `redir` command on the [golang.design](https://go
2929
server. Here is the overview of its usage:
3030

3131
```
32-
usage: redir [-s] [-op <operator> -a <alias> -l <link>]
32+
usage: redir [-s] [-f <file>] [-op <operator> -a <alias> -l <link>]
3333
options:
3434
-a string
3535
alias for a new link
36+
-f string
37+
import aliases from a YAML file
3638
-l string
3739
actual link for the alias, optional for delete/fetch
3840
-op string
3941
operators, create/update/delete/fetch (default "create")
4042
-s run redir service
4143
example:
4244
redir -s run the redir service
45+
redir -f ./import.yml import aliases from a file
4346
redir -a alias -l link allocate new short link if possible
4447
redir -op fetch -a alias fetch alias information
4548
```
4649

47-
For the command line usage, one only need to use `-a`, `-l` and `-op` if needed.
48-
The command will talk to the redis data store and issue a new allocated alias.
50+
For the command line usage, one only needs to use `-a`, `-l`, and `-op` if needed.
51+
The command will talk to the Redis data store and issue a new allocated alias.
4952
For instance, the following command:
5053

5154
```
@@ -54,6 +57,14 @@ redir -a changkun -l https://changkun.de
5457

5558
creates a new alias under [golang.design/s/changkun](https://golang.design/s/changkun).
5659

60+
Import from a YAML file is also possible, for instance:
61+
62+
```
63+
redir -f import.yml
64+
```
65+
66+
The aliases are either imported as a new alias or updated for an existing alias.
67+
5768
Moreover, it is possible to visit [`/s`](https://golang.design/s) directly listing all exist aliases under [golang.design](https://golang.design/).
5869

5970
## Build
@@ -79,4 +90,4 @@ make clean # cleanup
7990

8091
## License
8192

82-
MIT &copy; The golang.design Initiative Authors
93+
MIT &copy; The [golang.design](https://golang.design) Initiative Authors

0 commit comments

Comments
 (0)