forked from adtac/climate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme-generate.py
More file actions
executable file
·99 lines (74 loc) · 2.48 KB
/
readme-generate.py
File metadata and controls
executable file
·99 lines (74 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env python
with open("climate") as file:
lines = file.readlines()
print("# climate\n")
print("The ultimate command line tool for Linux!\n")
print("\n")
print("**climate** provides a huge number of command line options "
"for developers to automate their Linux system.\n")
print("""
## Installation
Clone the repository and run the `install` command:
```bash
$ git clone https://github.com/adtac/climate.git
$ cd climate
$ sudo ./install
```
The default location is `/usr/local/bin/`. If you want to write to a
different location, you can give an argument to the install command.
```bash
$ ./install [location]
```
You can also install using `curl` (although note that this
[might be insecure](https://www.seancassidy.me/dont-pipe-to-your-shell.html))
```bash
$ bash -c "$(curl -fsSL https://raw.githubusercontent.com/adtac/climate/master/install)"
```
Using `wget`:
```bash
$ bash -c "$(wget https://raw.githubusercontent.com/adtac/climate/master/install -q -O -)"
```
And that's it! It should automatically look for dependencies and install them.
After that's done, run `climate` to see the whole list of commands supported.
""")
print("""
## Requirements
`climate` has the following dependencies:
```
upower wget curl rar unzip 7z dig git python pip node npm fdupes glances speedtest sensors sshfs http-server is-up
```
The installation command should automatically install these for `apt`-based systems
and `yum`-based systems (and of course, `dnf`). For others, please install them manually.
""")
# commands
print("""
## Commands
""")
begun = False
print("**Meta**:\n")
print("Command | Description")
print("--- | ---")
for line in lines:
line = line.strip()
if begun and line.startswith("printf "):
split = line.split("${PLAIN_BOLD}")
if len(split) > 1:
section = split[1].split(":")[0]
print("\n\n**" + section + "**:\n")
print("Command | Description")
print("--- | ---")
if begun and line.startswith("# ---"):
break
if line.startswith("shelp"):
line = line.split('"')
if len(line) > 2:
begun = True
command = " `climate " + line[1] + "`"
helptext = line[3]
print(command + " | " + helptext)
print("""\n
## License
Thanks to [guarinogabriel/Mac-CLI](https://github.com/guarinogabriel/Mac-CLI)
for the idea.
See the [LICENSE](LICENSE.md) file for license rights and limitations (AGPL).
""")