crates-tui icon indicating copy to clipboard operation
crates-tui copied to clipboard

Better command line help defaults

Open kdheepak opened this issue 7 months ago • 1 comments

Currently this is what crates-tui --help prints out:

$ crates-tui --help
A TUI for crates.io

Usage: crates-tui [OPTIONS]

Options:
  -t, --tick-rate <FLOAT>
          Tick rate, i.e. number of ticks per second

          [default: 1]

      --print-default-config
          Print default configuration

  -c, --config-file <FILE>
          A path to a crates-tui configuration file

      --color-file <FILE>
          A path to a base16 color file

  -f, --frame-rate <FLOAT>
          Frame rate, i.e. number of frames per second

          [default: 15]

      --data-dir <DIR>
          The directory to use for storing application data

      --log-level <LEVEL>
          The log level to use.

          Valid values are: error, warn, info, debug, trace, off. The default is info.

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version
$ crates-tui --help
A TUI for crates.io

Usage: crates-tui [OPTIONS]

Options:
  -t, --tick-rate <FLOAT>
          Tick rate, i.e. number of ticks per second

          [default: 1]

      --print-default-config
          Print default configuration

  -c, --config-file <FILE>
          A path to a crates-tui configuration file

          [default: "/Users/USERNAME/Library/Application Support/rs.ratatui.crates-tui/config.toml"]

      --data-dir <DIR>
          The directory to use for storing application data

          [default: "/Users/USERNAME/Library/Application Support/rs.ratatui.crates.tui"]

      --config-dir <DIR>
          The directory to use for storing application data

          [default: "/Users/USERNAME/Library/Application Support/rs.ratatui.crates.tui"]

  -f, --frame-rate <FLOAT>
          Frame rate, i.e. number of frames per second

          [default: 15]

      --log-level <LEVEL>
          The log level to use.

          Valid values are: error, warn, info, debug, trace, off. The default is info.

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Here's the diff:

--- without-default.txt 2024-06-30 14:10:53
+++ with-defaults.txt   2024-06-30 14:13:20
@@ -15,9 +15,13 @@
   -c, --config-file <FILE>
           A path to a crates-tui configuration file

+          [default: "/Users/USERNAME/Library/Application Support/rs.ratatui.crates-tui/config.toml"]
+
       --color-file <FILE>
           A path to a base16 color file

+          [default: "/Users/USERNAME/Library/Application Support/rs.ratatui.crates.tui/color.toml"]
+
   -f, --frame-rate <FLOAT>
           Frame rate, i.e. number of frames per second

@@ -26,6 +30,8 @@
       --data-dir <DIR>
           The directory to use for storing application data

+          [default: "/Users/USERNAME/Library/Application Support/rs.ratatui.crates.tui"]
+
       --log-level <LEVEL>
           The log level to use.

I think this would be a better experience for users.

kdheepak avatar Jun 30 '24 18:06 kdheepak