Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a6371574a7 | ||
|
92d384573e | ||
|
4468f606ed |
@ -12,7 +12,7 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = 'com.jdbernard'
|
group = 'com.jdbernard'
|
||||||
version = '0.1.1'
|
version = '0.1.3'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
@ -28,7 +28,7 @@ import static com.jdbernard.wdiwtlt.cli.CliErr.*
|
|||||||
|
|
||||||
public class CommandLineInterface {
|
public class CommandLineInterface {
|
||||||
|
|
||||||
public static final VERSION = "0.1.1"
|
public static final VERSION = "0.1.3"
|
||||||
|
|
||||||
public static final def DOC = """\
|
public static final def DOC = """\
|
||||||
wdiwtlt v$VERSION
|
wdiwtlt v$VERSION
|
||||||
@ -97,14 +97,14 @@ Configuration:
|
|||||||
private String titleStyle, normalStyle, statusStyle, promptStyle,
|
private String titleStyle, normalStyle, statusStyle, promptStyle,
|
||||||
artistStyle, albumStyle, fileStyle, errorStyle, playlistStyle,
|
artistStyle, albumStyle, fileStyle, errorStyle, playlistStyle,
|
||||||
cmdStyle, optStyle
|
cmdStyle, optStyle
|
||||||
|
private String eraseToEnd = new ANSI().eraseLine(Erase.ToEnd).toString()
|
||||||
private String clearLine = new ANSI().eraseLine(Erase.All).toString()
|
private String clearLine = new ANSI().eraseLine(Erase.All).toString()
|
||||||
private String afterInput =
|
private String afterInput =
|
||||||
new ANSI().eraseLine(Erase.All).scrollUp().cursorUp().toString()
|
new ANSI().eraseLine(Erase.All).scrollUp().cursorUp().toString()
|
||||||
private String beforeLeader =
|
private String beforeLeader =
|
||||||
new ANSI().saveCursor().cursorPrevLine(3).toString()
|
new ANSI().saveCursor().cursorPrevLine(3).toString()
|
||||||
private String afterLeader =
|
private String afterLeader =
|
||||||
new ANSI().restoreCursor().eraseLine(Erase.ToEnd).toString()
|
new ANSI().restoreCursor().toString()
|
||||||
private String eraseLeader =
|
private String eraseLeader =
|
||||||
new ANSI().eraseLine(Erase.All).cursorPrevLine().eraseLine(Erase.All)
|
new ANSI().eraseLine(Erase.All).cursorPrevLine().eraseLine(Erase.All)
|
||||||
.cursorPrevLine().eraseLine(Erase.All)
|
.cursorPrevLine().eraseLine(Erase.All)
|
||||||
@ -391,7 +391,8 @@ Configuration:
|
|||||||
printLongMessage(errorStyle + errMsg + normalStyle) }
|
printLongMessage(errorStyle + errMsg + normalStyle) }
|
||||||
else {
|
else {
|
||||||
status.text = errorStyle + errMsg + normalStyle
|
status.text = errorStyle + errMsg + normalStyle
|
||||||
dismissMsgDate = new Date(new Date().time + msgTimeout) } } }
|
dismissMsgDate = new Date(new Date().time + msgTimeout) } }
|
||||||
|
outStream.print eraseToEnd }
|
||||||
else {
|
else {
|
||||||
drawLeader()
|
drawLeader()
|
||||||
if (curMediaFile &&
|
if (curMediaFile &&
|
||||||
@ -405,8 +406,13 @@ Configuration:
|
|||||||
Thread.sleep(250) } } }
|
Thread.sleep(250) } } }
|
||||||
|
|
||||||
private def processInput(String line) {
|
private def processInput(String line) {
|
||||||
|
line = line.trim()
|
||||||
logger.debug("line: $line")
|
logger.debug("line: $line")
|
||||||
|
|
||||||
|
if (line.indexOf(' and ') > 0 || line.indexOf(';')> 0) {
|
||||||
|
String[] cmds = line.split(/ and |;/)
|
||||||
|
return cmds.collect(this.&processInput) }
|
||||||
|
|
||||||
String[] parts = line.split(' ', 2)
|
String[] parts = line.split(' ', 2)
|
||||||
String command = parts[0]?.toLowerCase()
|
String command = parts[0]?.toLowerCase()
|
||||||
String rest = parts.size() == 2 ? parts[1]?.trim() : null
|
String rest = parts.size() == 2 ? parts[1]?.trim() : null
|
||||||
@ -551,6 +557,7 @@ Configuration:
|
|||||||
[(idKeyFor(selectionClass)): it.id]) }.findAll()
|
[(idKeyFor(selectionClass)): it.id]) }.findAll()
|
||||||
|
|
||||||
case ~/absent files/:
|
case ~/absent files/:
|
||||||
|
scanMediaLibrary()
|
||||||
return library.getMediaFilesWhere(presentLocally: false)
|
return library.getMediaFilesWhere(presentLocally: false)
|
||||||
|
|
||||||
case ~/files tagged( as){0,1}((\s[^\s]+)+)/:
|
case ~/files tagged( as){0,1}((\s[^\s]+)+)/:
|
||||||
|
@ -25,6 +25,6 @@ dependencies {
|
|||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
|
|
||||||
runtime 'com.h2database:h2:1.4.185'
|
runtime 'com.h2database:h2:1.4.192'
|
||||||
runtime 'org.postgresql:postgresql:9.4.1207.jre7'
|
runtime 'org.postgresql:postgresql:9.4.1207.jre7'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user