actually only for flags

This commit is contained in:
Lilian Jónsdóttir 2024-06-19 21:59:04 -07:00
parent d671daa2f1
commit f7605f6eab

33
main.go
View file

@ -238,14 +238,14 @@ var (
global_flags = []cli.Flag{ global_flags = []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{
Name: "log", Name: "log",
Usage: "Log level", Usage: "log level",
Value: "warn", Value: "warn",
Aliases: []string{"l"}, Aliases: []string{"l"},
Destination: &loglvl, Destination: &loglvl,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "confirm", Name: "confirm",
Usage: "Ask for confirmation before executing any action", Usage: "ask for confirmation before executing any action",
Value: false, Value: false,
Aliases: []string{"c"}, Aliases: []string{"c"},
DisableDefaultText: true, DisableDefaultText: true,
@ -256,62 +256,65 @@ var (
filter_flags = []cli.Flag{ filter_flags = []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{
Name: "match", Name: "match",
Usage: "Operate on files matching regex `PATTERN`", Usage: "operate on files matching regex `PATTERN`",
Aliases: []string{"m"}, Aliases: []string{"m"},
Destination: &p, Destination: &p,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "glob", Name: "glob",
Usage: "Operate on files matching `GLOB`", Usage: "operate on files matching `GLOB`",
Aliases: []string{"g"}, Aliases: []string{"g"},
Destination: &g, Destination: &g,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "not-match", Name: "not-match",
Usage: "Operate on files not matching regex `PATTERN`", Usage: "operate on files not matching regex `PATTERN`",
Aliases: []string{"M"}, Aliases: []string{"M"},
Destination: &unp, Destination: &unp,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "not-glob", Name: "not-glob",
Usage: "Operate on files not matching `GLOB`", Usage: "operate on files not matching `GLOB`",
Aliases: []string{"G"}, Aliases: []string{"G"},
Destination: &ung, Destination: &ung,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "on", Name: "on",
Usage: "Operate on files modified on `DATE`", Usage: "operate on files modified on `DATE`",
Aliases: []string{"o"}, Aliases: []string{"o"},
Destination: &o, Destination: &o,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "after", Name: "after",
Usage: "Operate on files modified before `DATE`", Usage: "operate on files modified before `DATE`",
Aliases: []string{"a"}, Aliases: []string{"a"},
Destination: &a, Destination: &a,
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "before", Name: "before",
Usage: "Operate on files modified after `DATE`", Usage: "operate on files modified after `DATE`",
Aliases: []string{"b"}, Aliases: []string{"b"},
Destination: &b, Destination: &b,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "files-only", Name: "files-only",
Usage: "Operate on files only", Usage: "operate on files only",
Aliases: []string{"f"}, Aliases: []string{"f"},
DisableDefaultText: true,
Destination: &fo, Destination: &fo,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "dirs-only", Name: "dirs-only",
Usage: "Operate on directories only", Usage: "operate on directories only",
Aliases: []string{"d"}, Aliases: []string{"d"},
DisableDefaultText: true,
Destination: &do, Destination: &do,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "ignore-hidden", Name: "ignore-hidden",
Usage: "Operate on unhidden files only", Usage: "operate on unhidden files only",
Aliases: []string{"i"}, Aliases: []string{"i"},
DisableDefaultText: true,
Destination: &ih, Destination: &ih,
}, },
} }
@ -319,7 +322,7 @@ var (
trash_flags = []cli.Flag{ trash_flags = []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "recursive", Name: "recursive",
Usage: "Trash files recursively", Usage: "operate on files recursively",
Aliases: []string{"r"}, Aliases: []string{"r"},
Destination: &recursive, Destination: &recursive,
Value: false, Value: false,
@ -327,7 +330,7 @@ var (
}, },
&cli.PathFlag{ &cli.PathFlag{
Name: "work-dir", Name: "work-dir",
Usage: "Trash files in this `DIRECTORY`", Usage: "operate on files in this `DIRECTORY`",
Aliases: []string{"w"}, Aliases: []string{"w"},
Destination: &workdir, Destination: &workdir,
}, },
@ -336,7 +339,7 @@ var (
alreadyintrash_flags = []cli.Flag{ alreadyintrash_flags = []cli.Flag{
&cli.PathFlag{ &cli.PathFlag{
Name: "original-path", Name: "original-path",
Usage: "Operate on files trashed from this `DIRECTORY`", Usage: "operate on files trashed from this `DIRECTORY`",
Aliases: []string{"O"}, Aliases: []string{"O"},
Destination: &ogdir, Destination: &ogdir,
}, },