]> git.r.bdr.sh - rbdr/lyricli/blob - Sources/arguments_source.swift
d1bf4c607a992e3ce91ad4357531ba965b7f5d8a
[rbdr/lyricli] / Sources / arguments_source.swift
1 /// Source that deals with command line
2 class ArgumentsSource: Source {
3 public var currentTrack: Track? {
4 if CommandLine.arguments.count >= 3 {
5
6 // expected usage: $ ./lyricli <artist> <name>
7
8 let trackName: String = CommandLine.arguments[2]
9 let trackArtist: String = CommandLine.arguments[1]
10
11 return Track(withName: trackName, andArtist: trackArtist)
12 }
13 return nil
14 }
15 }