Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit 186dacd

Browse files
committed
update readme
1 parent 095aa3d commit 186dacd

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

readme.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
## gohost
2+
3+
Gohost is a simple host switcher tool supporting Linux, macOS and Windows.
4+
5+
**To modify the system host file gohost need running in admin mode, such as `sudo gohost` in Linux and macOS
6+
or `Admin CMD` in Windows.**
7+
8+
## Usage
9+
10+
### And new host file
11+
12+
`gohost new HOST_NAME GROUP_NAME_1 GROUP_NAME_2 ... `
13+
14+
For example
15+
16+
```shell
17+
# create a devHost host file which belongs to dev1 and dev2 group
18+
> gohost new devHost dev1 dev2
19+
```
20+
21+
### Edit existed host file
22+
> Make sure `vim` is in system PATH
23+
24+
`gohost edit HOST_NAME`
25+
26+
27+
### Delete existed host file
28+
29+
`gohost rm HOST_NAME`
30+
31+
32+
### List host
33+
34+
`gohost ls [-a]`
35+
36+
For example
37+
38+
```shell
39+
# List host group
40+
> gohost ls
41+
+-------+---------+
42+
| GROUP | HOSTS |
43+
+-------+---------+
44+
| dev1 | devHost |
45+
| dev2 | devHost |
46+
+-------+---------+
47+
48+
# List host
49+
> gohost ls -a
50+
+---------+------------+
51+
| HOST | GROUPS |
52+
+---------+------------+
53+
| devHost | dev1, dev2 |
54+
+---------+------------+
55+
56+
```
57+
58+
59+
### Add group to existed host
60+
61+
`gohost cg HOST_NAME [ -a | -d ] GROUP_NAME_1,GROUP_NAME_2...`
62+
63+
For example
64+
65+
```shell
66+
# add group dev3, dev4 for devHost
67+
> gohost cg devHost -a dev3,dev4
68+
added groups 'dev3, dev4'
69+
+---------+------------------------+
70+
| HOST | GROUPS |
71+
+---------+------------------------+
72+
| devHost | dev1, dev2, dev3, dev4 |
73+
+---------+------------------------+
74+
75+
# remove group dev1 for devHost
76+
> gohost cg devHost -d dev1
77+
removed groups 'dev1'
78+
+---------+------------------+
79+
| HOST | GROUPS |
80+
+---------+------------------+
81+
| devHost | dev2, dev3, dev4 |
82+
+---------+------------------+
83+
```
84+
85+
86+
### Use group host as system host
87+
88+
`gohost use GROUP_NAME`
89+
90+
91+
### Display current system host
92+
93+
`gohost sys`

0 commit comments

Comments
 (0)