Repository: sharkdp/fd (language: rust)

Issue:
Improve time option usage
For fd's [time options](https://github.com/sharkdp/fd/blob/master/src/app.rs#L411-L444) consider adding these two tweaks

-  `--newer` and `--older` [visible clap aliases](https://docs.rs/clap/2.32.0/clap/struct.Arg.html#method.visible_aliases)
- default the time component to `00:00:00` when only a date is given

which would turn this verbose incantation

    $ fd -t f --change-newer-than '2020-06-29 00:00:00' abcF08m1002r00ec12843000000a5p /opt/datastore/data/prod/xml/schema/xyz/

into a slightly less verbose and more memorable

    $ fd -t f --newer 2020-06-29 abcF08m1002r00ec12843000000a5p /opt/datastore/data/prod/xml/schma/xyz/

Looks like you're using modified time metadata, so these shorter long names are potentially confusing. But I didn't like `--newermt` and `--oldermt`. Ah, the age old naming challenge.


Discussion / hints:
Thank you for your feedback.

Both ideas sound good to me!
This issue can be closed (PR #645 implemented both features).
released in [v8.2.0](https://github.com/sharkdp/fd/releases/tag/v8.2.0).
The #645 changes to add `--newer` and `--older` aliases are not showing up in the short or long `--help` text, nor is there mention that the time component defaults to 00:00:00 when only a date is given.

~~~
$ fd --help
fd 8.2.1
...
        --changed-within <date|dur>
            Filter results based on the file modification time. The argument can be provided as a
            specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). '--change-
            newer-than' can be used as an alias.
            Examples:
                --changed-within 2weeks
                --change-newer-than '2018-10-27 10:00:00'
        --changed-before <date|dur>
            Filter results based on the file modification time. The argument can be provided as a
            specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). '--change-
            older-than' can be used as an alias.
            Examples:
                --changed-before '2018-10-27 10:00:00'
                --change-older-than 2weeks
~~~
@jonforums Thanks. Let's fix that.

Fix patch:
diff --git a/src/app.rs b/src/app.rs
index 93496d623..5781daa85 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -442,10 +442,12 @@ pub fn build_app() -> App<'static, 'static> {
                 .long_help(
                     "Filter results based on the file modification time. The argument can be provided \
                      as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \
-                     '--change-newer-than' can be used as an alias.\n\
+                     If the time is not specified, it defaults to 00:00:00. \
+                     '--change-newer-than' or '--newer' can be used as aliases.\n\
                      Examples:\n    \
                          --changed-within 2weeks\n    \
-                         --change-newer-than '2018-10-27 10:00:00'",
+                         --change-newer-than '2018-10-27 10:00:00'\n    \
+                         --newer 2018-10-27",
                 ),
         )
         .arg(
@@ -460,10 +462,11 @@ pub fn build_app() -> App<'static, 'static> {
                 .long_help(
                     "Filter results based on the file modification time. The argument can be provided \
                      as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \
-                     '--change-older-than' can be used as an alias.\n\
+                     '--change-older-than' or '--older' can be used as aliases.\n\
                      Examples:\n    \
                          --changed-before '2018-10-27 10:00:00'\n    \
-                         --change-older-than 2weeks",
+                         --change-older-than 2weeks\n    \
+                         --older 2018-10-27",
                 ),
         )
         .arg(


Test patch: