Skip to content

Commit 1ded84c

Browse files
committed
adding -sdd (--show_dirs) command line parameter and updating docs
1 parent b4547de commit 1ded84c

File tree

4 files changed

+32
-13
lines changed

4 files changed

+32
-13
lines changed

docs/index.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,13 +1310,15 @@ <h2 id="installation">Installation <span style="padding-left: 10px;"><sup style=
13101310
<p>The best way to install <strong>PyRadio</strong> is via a distribution package, if one exists (<em>Arch Linux</em> and derivatives can install <a target="_blank" href="https://aur.archlinux.org/packages/?K=pyradio">any of these packages</a> from the AUR, <em>FreeBSD</em> users will find it in the <a target="_blank" href="https://www.freshports.org/audio/py-pyradio/">ports</a>, etc.).</p>
13111311
<p>In any other case, and since <strong>PyRadio</strong> is currently not available via pip, you will have to <a href="build.html">build it from source</a>.</p>
13121312
<h2 id="command-line-options">Command line options <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
1313-
<pre>Usage: pyradio [-h] [-c CONFIG_DIR] [-p [STATION_NUMBER]] [-u PLAYER] [-l]
1314-
[-lt] [-sd] [-od] [-pc] [-d] [-ul] [-us] [-U] [-R] [-V] [-ls]
1315-
[-s PLAYLIST] [-tlp] [-t THEME] [--show-themes] [--no-themes]
1316-
[--write-theme IN_THEME OUT_THEME,] [--terminal TERMINAL]
1317-
[--terminal-param TERMINAL_PARAM] [-oc] [-sc] [-cc] [-gc] [-r]
1318-
[-or] [-lr] [-mkv MKV_FILE] [-scv PNG_FILE] [-srt] [-ach]
1319-
[--headless IP_AND_PORT] [--address] [-fd]
1313+
<pre># pyradio -h
1314+
Usage: pyradio [-h] [-c CONFIG_DIR] [-p [STATION_NUMBER]] [-u PLAYER] [-l]
1315+
[-lt] [-sds] [-sd] [-od] [-pc] [-d] [-ul] [-us] [-U] [-R] [-V]
1316+
[-ls] [-s PLAYLIST] [-tlp] [-t THEME] [--show-themes]
1317+
[--no-themes] [--write-theme IN_THEME OUT_THEME,]
1318+
[--terminal TERMINAL] [--terminal-param TERMINAL_PARAM] [-oc]
1319+
[-sc] [-cc] [-gc] [-r] [-or] [-lr] [-mkv MKV_FILE]
1320+
[-scv PNG_FILE] [-srt] [-ach] [--headless IP_AND_PORT]
1321+
[--address] [-fd]
13201322

13211323
Curses based Internet Radio Player
13221324

@@ -1335,6 +1337,7 @@ <h2 id="command-line-options">Command line options <span style="padding-left: 10
13351337
mpv, mplayer, vlc.
13361338
-l, --list List of available stations in a playlist.
13371339
-lt, --log-titles Log titles to file.
1340+
-sds, --show-dirs Print all the directories used by PyRadio and exit.
13381341
-sd, --show-config-dir
13391342
Print config directory [CONFIG DIR] location and exit.
13401343
-od, --open-config-dir

docs/index.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,15 @@ In any other case, and since **PyRadio** is currently not available via pip, you
121121
## Command line options
122122

123123
```
124+
# pyradio -h
124125
Usage: pyradio [-h] [-c CONFIG_DIR] [-p [STATION_NUMBER]] [-u PLAYER] [-l]
125-
[-lt] [-sd] [-od] [-pc] [-d] [-ul] [-us] [-U] [-R] [-V] [-ls]
126-
[-s PLAYLIST] [-tlp] [-t THEME] [--show-themes] [--no-themes]
127-
[--write-theme IN_THEME OUT_THEME,] [--terminal TERMINAL]
128-
[--terminal-param TERMINAL_PARAM] [-oc] [-sc] [-cc] [-gc] [-r]
129-
[-or] [-lr] [-mkv MKV_FILE] [-scv PNG_FILE] [-srt] [-ach]
130-
[--headless IP_AND_PORT] [--address] [-fd]
126+
[-lt] [-sds] [-sd] [-od] [-pc] [-d] [-ul] [-us] [-U] [-R] [-V]
127+
[-ls] [-s PLAYLIST] [-tlp] [-t THEME] [--show-themes]
128+
[--no-themes] [--write-theme IN_THEME OUT_THEME,]
129+
[--terminal TERMINAL] [--terminal-param TERMINAL_PARAM] [-oc]
130+
[-sc] [-cc] [-gc] [-r] [-or] [-lr] [-mkv MKV_FILE]
131+
[-scv PNG_FILE] [-srt] [-ach] [--headless IP_AND_PORT]
132+
[--address] [-fd]
131133
132134
Curses based Internet Radio Player
133135
@@ -146,6 +148,7 @@ General options:
146148
mpv, mplayer, vlc.
147149
-l, --list List of available stations in a playlist.
148150
-lt, --log-titles Log titles to file.
151+
-sds, --show-dirs Print all the directories used by PyRadio and exit.
149152
-sd, --show-config-dir
150153
Print config directory [CONFIG DIR] location and exit.
151154
-od, --open-config-dir

docs/pyradio.1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ used to specify detection order. Supported players:
3838
List of available stations in a playlist.
3939
.IP\ \fB-lt\fR,\ \fB--log\fR\fB-titles\fR
4040
Log titles to file.
41+
.IP\ \fB-sds\fR,\ \fB--show\fR\fB-dirs\fR
42+
Print all the directories used by PyRadio and exit.
4143
.IP\ \fB-sd\fR,\ \fB--show\fR\fB-config\fR\fB-dir\fR
4244
Print config directory [\fICONFIG\fR \fIDIR\fR] location and exit.
4345
.IP\ \fB-od\fR,\ \fB--open\fR\fB-config\fR\fB-dir\fR

pyradio/main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ def shell():
254254

255255
parser.add_argument('-lt', '--log-titles', action='store_true',
256256
help='Log titles to file.')
257+
parser.add_argument('-sds', '--show-dirs', action='store_true',
258+
help='Print all the directories used by PyRadio and exit.')
257259
parser.add_argument('-sd', '--show-config-dir', action='store_true',
258260
help='Print config directory [CONFIG DIR] location and exit.')
259261
parser.add_argument('-od', '--open-config-dir', action='store_true',
@@ -649,6 +651,15 @@ def shell():
649651
pyradio_config.force_to_remove_lock_file = True
650652
return
651653

654+
if args.show_dirs:
655+
print('[magenta]Directories used by PyRadio[/magenta]')
656+
print(' Config dir: "[red]{}[/red]"'.format(pyradio_config.stations_dir))
657+
print(' Data dir: "[red]{}[/red]"'.format(pyradio_config.data_dir))
658+
print(' State dir: "[red]{}[/red]"'.format(pyradio_config.state_dir))
659+
print(' Cache dir: "[red]{}[/red]"'.format(pyradio_config.cache_dir))
660+
print('Recordings dir: "[red]{}[/red]"'.format(pyradio_config.recording_dir))
661+
return
662+
652663
if args.show_config_dir:
653664
print('[magenta]PyRadio[/magenta] config dir: "[red]{}[/red]"'.format(pyradio_config.stations_dir))
654665
return

0 commit comments

Comments
 (0)