Address code review comments

Add some documentation.
Create new util.InitFlags() function to merge and parse in one step.
This commit is contained in:
Joe Beda
2015-01-14 14:59:55 -08:00
parent 1d0b6ee5f5
commit 6bd6b905f5
10 changed files with 36 additions and 17 deletions

27
pkg/util/flags.go Normal file
View File

@@ -0,0 +1,27 @@
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package util
import (
flag "github.com/spf13/pflag"
)
// InitFlags normalizes and parses the command line flags
func InitFlags() {
AddAllFlagsToPFlags()
flag.Parse()
}