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