...

Source file src/github.com/Microsoft/hcsshim/cmd/gcstools/main.go

Documentation: github.com/Microsoft/hcsshim/cmd/gcstools

     1  //go:build linux
     2  // +build linux
     3  
     4  package main
     5  
     6  import (
     7  	"fmt"
     8  	"os"
     9  	"path/filepath"
    10  )
    11  
    12  var commands = map[string]func(){
    13  	"generichook":     genericHookMain,
    14  	"install-drivers": installDriversMain,
    15  }
    16  
    17  func main() {
    18  	cmd := filepath.Base(os.Args[0])
    19  	mainFunc := commands[cmd]
    20  	if mainFunc == nil {
    21  		fmt.Fprintf(os.Stderr, "unknown command: %s\n", cmd)
    22  		fmt.Fprintf(os.Stderr, "known commands:\n")
    23  		for k := range commands {
    24  			fmt.Fprintf(os.Stderr, "\t%s\n", k)
    25  		}
    26  		os.Exit(127)
    27  	}
    28  
    29  	mainFunc()
    30  }
    31  

View as plain text