blob: c21e1ca43cbf7ec883331032da20f23336c5c4e5 [file] [log] [blame]
Asim Shankarc33b4642014-10-07 00:24:52 -07001// Package flag provides flag definitions for the suidhelper package.
2//
3// It does NOT depend on any packages outside the Go standard library.
4// This allows veyron.io/veyron/veyron/lib/testutil to depend on this
5// package, thereby ensuring that the suidhelper flags are defined
6// before the flag.Parse call in testutil.init is made.
7//
8// This is a hack! This file should go away once testutil.init
9// is changed to not parse flags in init().
10// TODO(cnicolaou,ashankar): See above!
11package flag
12
13import "flag"
14
15var (
16 Username, Workspace, StdoutLog, StderrLog, Run *string
17 MinimumUid *int64
18)
19
20func init() {
21 SetupFlags(flag.CommandLine)
22}
23
24func SetupFlags(fs *flag.FlagSet) {
25 Username = fs.String("username", "", "The UNIX user name used for the other functions of this tool.")
26 Workspace = fs.String("workspace", "", "Path to the application's workspace directory.")
27 StdoutLog = fs.String("stdoutlog", "", "Path to the stdout log file.")
28 StderrLog = fs.String("stderrlog", "", "Path to the stdin log file.")
29 Run = fs.String("run", "", "Path to the application to exec.")
30 MinimumUid = fs.Int64("minuid", uidThreshold, "UIDs cannot be less than this number.")
31}
32
33const uidThreshold = 501