diff --git a/cmd/fml/fml.go b/cmd/fml/fml.go index 7bb51a2..b120c9b 100644 --- a/cmd/fml/fml.go +++ b/cmd/fml/fml.go @@ -16,7 +16,7 @@ import ( type config struct { modsdir, infile, outfile string mods modlist.Modlist - clobber bool + clobber, addmissing bool } var cfg config @@ -73,6 +73,12 @@ func main() { Required: false, Usage: "overwrite specified infile", }, + &cli.BoolFlag{ + Name: "no-add-missing", + Aliases: []string{"m"}, + Required: false, + Usage: "don't automatically add mods missing from infile", + }, }, Before: func(ctx *cli.Context) error { // Setup logger @@ -86,6 +92,7 @@ func main() { // Bool flags cfg.clobber = ctx.Bool("clobber") + cfg.addmissing = !ctx.Bool("no-add-missing") // Deal with in/out file var in = ctx.String("infile") @@ -116,10 +123,13 @@ func main() { return err } - err = modlist.AddModsNotInList(cfg.modsdir, &cfg.mods) - if err != nil { - return err + if cfg.addmissing { + err = modlist.AddModsNotInList(cfg.modsdir, &cfg.mods) + if err != nil { + return err + } } + selected, err := prompt.Show(&cfg.mods) if err != nil { log.Fatal(err)