code: func shiftFlags(mode string) []string {
  	modePos := 0
  	for k, v := range os.Args {
  		if v == mode {
  			modePos = k
  			break
  		}
  	}
  	globalFlags := os.Args[1:modePos]
  	return append(globalFlags, os.Args[modePos+1:]...)
  }
docs: // shiftFlags prepends all the arguments (global flags) passed before the given
  // mode to the list of arguments after that mode, and returns that list.