Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caddy
Commits
3b6c387b
Commit
3b6c387b
authored
Mar 13, 2016
by
Abiola Ibrahim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flag to list directives.
parent
35e4c1a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
main.go
main.go
+14
-5
No files found.
main.go
View file @
3b6c387b
...
...
@@ -14,6 +14,7 @@ import (
"github.com/mholt/caddy/caddy"
"github.com/mholt/caddy/caddy/https"
"github.com/mholt/caddy/caddy/parse"
"github.com/xenolf/lego/acme"
"gopkg.in/natefinch/lumberjack.v2"
)
...
...
@@ -36,6 +37,7 @@ func init() {
flag
.
StringVar
(
&
revoke
,
"revoke"
,
""
,
"Hostname for which to revoke the certificate"
)
flag
.
StringVar
(
&
caddy
.
Root
,
"root"
,
caddy
.
DefaultRoot
,
"Root path to default site"
)
flag
.
BoolVar
(
&
version
,
"version"
,
false
,
"Show version"
)
flag
.
BoolVar
(
&
directives
,
"directives"
,
false
,
"List supported directives"
)
}
func
main
()
{
...
...
@@ -77,6 +79,12 @@ func main() {
}
os
.
Exit
(
0
)
}
if
directives
{
for
d
:=
range
parse
.
ValidDirectives
{
fmt
.
Println
(
d
)
}
os
.
Exit
(
0
)
}
// Set CPU cap
err
:=
setCPU
(
cpu
)
...
...
@@ -212,11 +220,12 @@ const appName = "Caddy"
// Flags that control program flow or startup
var
(
conf
string
cpu
string
logfile
string
revoke
string
version
bool
conf
string
cpu
string
logfile
string
revoke
string
version
bool
directives
bool
)
// Build information obtained with the help of -ldflags
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment