func (f Flags) rideType() string {
	s := flagToRideType(f.car)
	if s == "" {
		log.Fatalf("unknown ride type %q", f.car)
	}
	return s
}
rideType returns the ride type for the specified flag,
or exits with a fatal error if the ride type is invalid.
package main
import (
	"bufio"
	"context"
	"errors"
	"flag"
	"fmt"
	"log"
	"os"
	"os/exec"
	"runtime"
	"strings"
	"text/tabwriter"
	"github.com/nishanths/lyft-go"
	"googlemaps.github.io/maps"
)
const help = `usage: lyft [flags] [ride|place] [subcommand args...]
Flags
  -type <ride-type>  Ride type: line, lyft, premier, lux, or luxsuv (default line).
  -dry-run           Dry-run; don't actually create or modify rides (default false).
  -to <place>        Use saved place as the end location for the ride.
  -notify            Show desktop notifications (default false), macOS only.
  -from <place>      Use saved place as the start location for the ride.
  -watch             Watch ride status updates (default false).
The ride subcommand can create, cancel, and track the status of rides.
  lyft ride create
  lyft ride cancel <ride-id>
  lyft ride status <ride-id>
The place subcommand can save ride start and end locations for future use.
  lyft place add    <name>
  lyft place remove <name>...
  lyft place show   [name]
The program uses the following environment variables.
  GOOG_GEOCODE_KEY
  LYFT_CLIENT_ID
  LYFT_CLIENT_SECRET
See https: 
`
func usage() {
	fmt.Fprint(os.Stderr, help)
	os.Exit(2)
}
const (
	rootDir      = ".lyft"
	internalFile = "internal.json"
	placesFile   = "places.json"
)
const (
	permRootDir = 0740
	permDir     = 0750
	permFile    = 0640
)
func main() {
	log.SetFlags(0)
	car := flag.String("type", "line", "")
	startPlace := flag.String("from", "", "")
	endPlace := flag.String("to", "", "")
	notifications := flag.Bool("notify", false, "")
	dryRun := flag.Bool("dry-run", false, "")
	watch := flag.Bool("watch", false, "")
	flag.Usage = usage
	flag.Parse()
	args := flag.Args()
	if len(args) == 0 {
		usage()
	}
	flags := Flags{
		car:           *car,
		startPlace:    *startPlace,
		endPlace:      *endPlace,
		notifications: *notifications,
		dryRun:        *dryRun,
		watch:         *watch || *notifications,
	}
	switch args[0] {
	case "ride":
		cmdRide(args[1:], flags)
	case "place":
		cmdPlace(args[1:])
	default:
		usage()
	}
}
type Flags struct {
	car           string
	startPlace    string
	endPlace      string
	notifications bool
	dryRun        bool
	watch         bool
}