XsaMain() is meant to be called by systemtest; there's no sense in
being able to call systemtest via XsaMain. Moving the test for
'systemtest' into main() allows us to get rid of systemtest
special-casing re argument counts.
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
}
func XsaMain(args []string) int {
- if len(args) < 3 && args[1] != "systemtest" {
+ if len(args) < 3 {
fmt.Printf("Not enough arguments\n")
return 1
}
loadXSA := false
tgt := args[1]
- args = args[2:]
-
- // Check for this first
- if tgt == "systemtest" {
- return MainSystemTest(args)
- }
-
- var cmd string
- if len(args) > 0 {
- cmd = args[0]
- args = args[1:]
- }
+ cmd := args[2]
+ args = args[3:]
if xsanum, err = strconv.Atoi(tgt); err == nil {
switch cmd {
}
func main() {
+ // 'systemtest' isn't subject to system testing, so shouldn't be in XsaMain
+ if len(os.Args) > 1 && os.Args[1] == "systemtest" {
+ os.Exit(MainSystemTest(os.Args))
+ }
+
Q.real = true
os.Exit(XsaMain(os.Args))
}