TomWhitwell / SlowMovie

MIT License
342 stars 67 forks source link

Help Menu Groups #112

Closed robweber closed 2 years ago

robweber commented 2 years ago

There are currently a lot of arguments that can be set in either the config file or passed via the command line. This doesn't change any of them in any way, but it does re-organize the help menu when using -h. Using argument groups, options are put into sections that help the user sort through which they may need in a better fashion. Instead of everything being listed in one lump it's now easier to tell which are for specifying the file to load, settings for frame updates, and EPD control.

Reorganized -h output now looks like this:

usage: slowmovie.py [-h] [-f FILE] [-D DIRECTORY] [-l] [-R]
                    [-o {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-r] [-d DELAY]
                    [-i INCREMENT] [-s START] [-S | -t] [-e EPD] [-c CONTRAST]
                    [-C]

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  video file to start playing; otherwise play the first
                        file in the videos directory
  -D DIRECTORY, --directory DIRECTORY
                        directory containing available videos to play
                        (default: Videos)
  -l, --loop            loop a single video; otherwise play through the files
                        in the videos directory
  -R, --random-file     play files in a random order; otherwise play them in
                        directory order
  -o {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        minimum importance-level of messages displayed and
                        saved to the logfile (default: INFO)

Frame Update Args:
  arguments that control frame updates and display

  -r, --random-frames   choose a random frame every refresh
  -d DELAY, --delay DELAY
                        delay in seconds between screen updates (default: 120)
  -i INCREMENT, --increment INCREMENT
                        advance INCREMENT frames each refresh (default: 4)
  -s START, --start START
                        start playing at a specific frame
  -S, --subtitles       display SRT subtitles
  -t, --timecode        display video timecode

EPD Args:
  arguments to select and modify the e-Ink display

  -e EPD, --epd EPD     the name of the display device driver to use
  -c CONTRAST, --contrast CONTRAST
                        adjust image contrast (default: 1.0)
  -C, --clear           clear display on exit

Args that start with '--' (eg. -f) can also be set in a config file
(slowmovie.conf). Config file syntax allows: key=value, flag=true,
stuff=[a,b,c] (for details, see syntax at https://goo.gl/R74nmi). If an arg is
specified in more than one place, then commandline values override config file
values which override defaults.
missionfloyd commented 2 years ago

Sounds good to me