sentence case for usage

This commit is contained in:
Lilian Jónsdóttir 2024-06-19 21:54:50 -07:00
parent 647a16dacb
commit d671daa2f1

36
main.go
View file

@ -81,7 +81,7 @@ var (
do_trash = &cli.Command{ do_trash = &cli.Command{
Name: "trash", Name: "trash",
Aliases: []string{"tr"}, Aliases: []string{"tr"},
Usage: "trash a file or files", Usage: "Trash a file or files",
Flags: slices.Concat(trash_flags, filter_flags), Flags: slices.Concat(trash_flags, filter_flags),
Before: before_commands, Before: before_commands,
Action: func(ctx *cli.Context) error { Action: func(ctx *cli.Context) error {
@ -136,7 +136,7 @@ var (
do_list = &cli.Command{ do_list = &cli.Command{
Name: "list", Name: "list",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Usage: "list trashed files", Usage: "List trashed files",
Flags: slices.Concat(alreadyintrash_flags, filter_flags), Flags: slices.Concat(alreadyintrash_flags, filter_flags),
Before: before_commands, Before: before_commands,
Action: func(ctx *cli.Context) error { Action: func(ctx *cli.Context) error {
@ -169,7 +169,7 @@ var (
do_restore = &cli.Command{ do_restore = &cli.Command{
Name: "restore", Name: "restore",
Aliases: []string{"re"}, Aliases: []string{"re"},
Usage: "restore a trashed file or files", Usage: "Restore a trashed file or files",
Flags: slices.Concat(alreadyintrash_flags, filter_flags), Flags: slices.Concat(alreadyintrash_flags, filter_flags),
Before: before_commands, Before: before_commands,
Action: func(ctx *cli.Context) error { Action: func(ctx *cli.Context) error {
@ -205,7 +205,7 @@ var (
do_clean = &cli.Command{ do_clean = &cli.Command{
Name: "clean", Name: "clean",
Aliases: []string{"cl"}, Aliases: []string{"cl"},
Usage: "clean files from trash", Usage: "Clean files from trash",
Flags: slices.Concat(alreadyintrash_flags, filter_flags), Flags: slices.Concat(alreadyintrash_flags, filter_flags),
Before: before_commands, Before: before_commands,
Action: func(ctx *cli.Context) error { Action: func(ctx *cli.Context) error {
@ -245,7 +245,7 @@ var (
}, },
&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,61 +256,61 @@ 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"},
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"},
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"},
Destination: &ih, Destination: &ih,
}, },
@ -319,7 +319,7 @@ var (
trash_flags = []cli.Flag{ trash_flags = []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "recursive", Name: "recursive",
Usage: "trash files recursively", Usage: "Trash files recursively",
Aliases: []string{"r"}, Aliases: []string{"r"},
Destination: &recursive, Destination: &recursive,
Value: false, Value: false,
@ -327,7 +327,7 @@ var (
}, },
&cli.PathFlag{ &cli.PathFlag{
Name: "work-dir", Name: "work-dir",
Usage: "trash files in this `DIRECTORY`", Usage: "Trash files in this `DIRECTORY`",
Aliases: []string{"w"}, Aliases: []string{"w"},
Destination: &workdir, Destination: &workdir,
}, },
@ -336,7 +336,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,
}, },