This repository was archived by the owner on Jul 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_info.go
132 lines (119 loc) · 2.73 KB
/
print_info.go
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package main
import (
"fmt"
"io"
)
func printVersion() {
fmt.Println(VERSION)
}
func printHelp(stream io.Writer) {
fmt.Fprintf(stream, `Usage: %s [option] path/to/project
Options:
-p _prog_ Set program name as _prog_
--program _prog_
-a _author_ Set project author as _author_
--author _author_
-b _brief_ Set project description as _brief_
--brief _brief_
-o _makefile_ Set config file to _makefile_, default to Makefile
--output _makefile_
-l _license_ Choose a open-source _license_
--license _license_
--licenses Show available licenses
-c, -C Generate a C project (default)
-cpp, -cxx Generate a C++ project
-std _std_ Set the standard version of the project
--standard _std_
--standards Show available standards
--console Generate a console project (default)
--library Generate a library project
--nested Generate a nested project (default)
--flat Generate a flat project
-s _dir_ Make a custom source directory at _dir_
--source _dir_
-i _dir_ Make a custom include directory at _dir_
--include _dir_
-d _dir Make a cust dist directory at _dir_
--dist _dist_
-t _dir_ Make a custom test directory at _dir_
--test _dir_
-e _dir_ Make a custom example directory at _dir_
--example _dir_
Custom directories only make effects in nested projects.
--custom Run interactively with more customization
-f, --force Remove all existing contents on path (Dangerous!)
-h, --help Show help message
-v, --version Show version info
To invoke %s interactively, run without any argument or with --custom
`, PROGRAM, PROGRAM)
}
func printLicenses() {
fmt.Printf(`None (none)
Apache License 2.0 (apache2)
GNU General Public License v3.0 (gpl3)
MIT License (mit)
---
BSD 2-clause "Simplified" license (bsd2)
BSD 3-clause "New" or "Revised" license (bsd3)
Eclipse Public License 2.0 (epl2)
GNU Affero General Public License v3.0 (agpl3)
GNU General Public License v2.0 (gpl2)
GNU Lesser General Public License v2.1 (lgpl2)
GNU Lesser General Public License v3.0 (lgpl3)
Mozilla Public License 2.0 (mpl2)
The Unlicense (unlicense)
`)
}
func printStandards() {
fmt.Printf(`c89
c90
c99
c11
c17
c18
gnu89
gnu90
gnu99
gnu11
gnu17
gnu18
c++98
c++03
c++11
c++14
c++17
gnu++98
gnu++03
gnu++11
gnu++14
gnu++17
`)
}
func PrintCStandards() {
fmt.Printf(`c89
c90
c99
c11
c17
c18
gnu89
gnu90
gnu99
gnu11
gnu17
gnu18
`)
}
func PrintCXXStandards() {
fmt.Printf(`c++98
c++03
c++11
c++14
c++17
gnu++98
gnu++03
gnu++11
gnu++14
gnu++17
`)
}