Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
0deccc70
Commit
0deccc70
authored
Jan 15, 2016
by
Eric Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: add version to command worker and overlord, print go version
Closes #272
parent
b5c7f197
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
main.go
cmd/dex-overlord/main.go
+9
-0
main.go
cmd/dex-worker/main.go
+8
-0
command_version.go
cmd/dexctl/command_version.go
+7
-2
No files found.
cmd/dex-overlord/main.go
View file @
0deccc70
...
@@ -7,6 +7,8 @@ import (
...
@@ -7,6 +7,8 @@ import (
"net/http"
"net/http"
"net/url"
"net/url"
"os"
"os"
"runtime"
"strings"
"time"
"time"
"github.com/coreos/go-oidc/key"
"github.com/coreos/go-oidc/key"
...
@@ -50,6 +52,8 @@ func main() {
...
@@ -50,6 +52,8 @@ func main() {
logDebug
:=
fs
.
Bool
(
"log-debug"
,
false
,
"log debug-level information"
)
logDebug
:=
fs
.
Bool
(
"log-debug"
,
false
,
"log debug-level information"
)
logTimestamps
:=
fs
.
Bool
(
"log-timestamps"
,
false
,
"prefix log lines with timestamps"
)
logTimestamps
:=
fs
.
Bool
(
"log-timestamps"
,
false
,
"prefix log lines with timestamps"
)
printVersion
:=
fs
.
Bool
(
"version"
,
false
,
"Print the version and exit"
)
if
err
:=
fs
.
Parse
(
os
.
Args
[
1
:
]);
err
!=
nil
{
if
err
:=
fs
.
Parse
(
os
.
Args
[
1
:
]);
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
.
Error
())
fmt
.
Fprintln
(
os
.
Stderr
,
err
.
Error
())
os
.
Exit
(
1
)
os
.
Exit
(
1
)
...
@@ -60,6 +64,11 @@ func main() {
...
@@ -60,6 +64,11 @@ func main() {
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
if
*
printVersion
{
fmt
.
Printf
(
"dex version %s
\n
go version %s
\n
"
,
strings
.
TrimPrefix
(
version
,
"v"
),
strings
.
TrimPrefix
(
runtime
.
Version
(),
"go"
))
os
.
Exit
(
0
)
}
if
*
logDebug
{
if
*
logDebug
{
log
.
EnableDebug
()
log
.
EnableDebug
()
}
}
...
...
cmd/dex-worker/main.go
View file @
0deccc70
...
@@ -7,6 +7,8 @@ import (
...
@@ -7,6 +7,8 @@ import (
"net/http"
"net/http"
"net/url"
"net/url"
"os"
"os"
"runtime"
"strings"
"time"
"time"
"github.com/coreos/pkg/flagutil"
"github.com/coreos/pkg/flagutil"
...
@@ -62,6 +64,7 @@ func main() {
...
@@ -62,6 +64,7 @@ func main() {
dbMaxIdleConns
:=
fs
.
Int
(
"db-max-idle-conns"
,
0
,
"maximum number of connections in the idle connection pool"
)
dbMaxIdleConns
:=
fs
.
Int
(
"db-max-idle-conns"
,
0
,
"maximum number of connections in the idle connection pool"
)
dbMaxOpenConns
:=
fs
.
Int
(
"db-max-open-conns"
,
0
,
"maximum number of open connections to the database"
)
dbMaxOpenConns
:=
fs
.
Int
(
"db-max-open-conns"
,
0
,
"maximum number of open connections to the database"
)
printVersion
:=
fs
.
Bool
(
"version"
,
false
,
"Print the version and exit"
)
// used only if --no-db is set
// used only if --no-db is set
connectors
:=
fs
.
String
(
"connectors"
,
"./static/fixtures/connectors.json"
,
"JSON file containg set of IDPC configs"
)
connectors
:=
fs
.
String
(
"connectors"
,
"./static/fixtures/connectors.json"
,
"JSON file containg set of IDPC configs"
)
...
@@ -81,6 +84,11 @@ func main() {
...
@@ -81,6 +84,11 @@ func main() {
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
if
*
printVersion
{
fmt
.
Printf
(
"dex version %s
\n
go version %s
\n
"
,
strings
.
TrimPrefix
(
version
,
"v"
),
strings
.
TrimPrefix
(
runtime
.
Version
(),
"go"
))
os
.
Exit
(
0
)
}
if
*
logDebug
{
if
*
logDebug
{
log
.
EnableDebug
()
log
.
EnableDebug
()
log
.
Infof
(
"Debug logging enabled."
)
log
.
Infof
(
"Debug logging enabled."
)
...
...
cmd/dexctl/command_version.go
View file @
0deccc70
package
main
package
main
import
"github.com/spf13/cobra"
import
(
"runtime"
"strings"
"github.com/spf13/cobra"
)
var
(
var
(
// set by the top level build script
// set by the top level build script
...
@@ -11,7 +16,7 @@ var (
...
@@ -11,7 +16,7 @@ var (
Short
:
"Print the dexctl version."
,
Short
:
"Print the dexctl version."
,
Long
:
"Print the dexctl version."
,
Long
:
"Print the dexctl version."
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
stdout
(
version
)
stdout
(
"dex version %s
\n
go version %s"
,
strings
.
TrimPrefix
(
version
,
"v"
),
strings
.
TrimPrefix
(
runtime
.
Version
(),
"go"
)
)
},
},
}
}
)
)
...
...
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