blob: b2c5430aad68472af3d8622867ed7376e10ff52e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# Lyricli (lrc)
A command line tool to show the lyrics of your current song.
## Usage
Lyricli can be invoked with the command `lrc`.
```
$ lrc [-t]
```
When you run it without arguments, it will look in the available source
to try to find a playing song and extract the lyrics. If you include the
`-t` flag, it will show the song and artist names before the lyrics.
```
$ lrc [-t] <artist_name> <song_name>
```
When you run it with arguments, it will use them to search for the
lyrics. This won't work if you manually disable the arguments source in
your configuration file. If you include the `-t` flag, it will show the
song and artist names before the lyrics.
### Commands
In order to configure sources, lyricli provides a few commands:
* `lrc -l` or `lrc --list-sources` lists the available sources. Enabled
sourcess will have a `*`
* `lrc -e` or `lrc --enable-source <source>` enables a source
* `lrc -d` or `lrc --disable-source <source>` disables a source without
resetting its configuration.
* `lrc -r` or `lrc --reset-source <source>` resets the configuration
for a source and disables it.
And you can print the help or the version:
* `lrc -v` or `lrc --version` prints the version
* `lrc -h` or `lrc --help` display built-in help
## Building
The build has only been tested on OSX using Swift 5.8 Building defaults
to the debug configuration.
```
make
```
### Configuration
To avoid storing the API key in source control, clientToken in the
lyrics_engine is using a placeholder value. You'll need to replace this
before building
* `GENIUS_CLIENT_TOKEN`: The Client token for your genius API client
## Installing from source
Builds lyricli in release configuration and copies the executable as
`lrc` to `/usr/local/bin`
```
make install
```
### Installing to a custom directory
This can be done by overriding the `install_path` variable
```
make install install_path=/opt/bin
```
## Linting and Generating Documentation
We use [swiftlint][swiftlint] to lint, and `make lint` to run it.
We use [jazzy][jazzy] and [SourceKitten][sourcekitten] to document, and
`make document` to generate it.
## Running tests
No tests at the moment 😬... but the makefile is mapped to run the swift
tests.
```
make test
```
[swiftlint]: https://github.com/realm/SwiftLint
[jazzy]: https://github.com/realm/jazzy
[sourcekitten]: https://github.com/jpsim/SourceKitten
|