Merge branch 'master' into add-assets
This commit is contained in:
commit
d3803d9d33
2 changed files with 16 additions and 7 deletions
|
@ -74,10 +74,4 @@ listTags(){
|
||||||
FROM tags LEFT JOIN links ON tags.id = links.tagID
|
FROM tags LEFT JOIN links ON tags.id = links.tagID
|
||||||
GROUP BY tags.id" |
|
GROUP BY tags.id" |
|
||||||
sqlite3 --column $header "${sqliteFile}"
|
sqlite3 --column $header "${sqliteFile}"
|
||||||
#echo "SELECT items.id,items.filename,items.title,items.type,
|
|
||||||
#GROUP_CONCAT(tags.name,',') tags
|
|
||||||
#FROM items LEFT JOIN links ON items.id = links.itemID
|
|
||||||
#LEFT JOIN tags ON links.tagID = tags.id
|
|
||||||
#GROUP BY items.id;" |
|
|
||||||
# sqlite3 --column --header "${sqliteFile}"
|
|
||||||
}
|
}
|
||||||
|
|
17
kb
17
kb
|
@ -235,11 +235,25 @@ listEntries(){
|
||||||
vecho "listEntries $*"
|
vecho "listEntries $*"
|
||||||
cd "$dataDir" || return
|
cd "$dataDir" || return
|
||||||
local header="--header"
|
local header="--header"
|
||||||
[ "$1" = "--noheader" ] && header=""
|
local typeorlist=""
|
||||||
|
while [ "$#" -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--noheader) header="" ;;
|
||||||
|
--normal) typeorlist+=" OR items.type = 'normal'" ;;
|
||||||
|
--assets) typeorlist+=" OR items.type = 'assets'" ;;
|
||||||
|
--links) typeorlist+=" OR items.type = 'links'" ;;
|
||||||
|
*) die "invalid list option: '$1'." ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
typeorlist="$(echo "$typeorlist" | sed 's/^ OR //')"
|
||||||
|
[ -z "$typeorlist" ] && typeorlist="items.type = 'normal'"
|
||||||
|
|
||||||
echo "SELECT items.id,items.filename,items.title,items.type,
|
echo "SELECT items.id,items.filename,items.title,items.type,
|
||||||
GROUP_CONCAT(tags.name,',') tags
|
GROUP_CONCAT(tags.name,',') tags
|
||||||
FROM items LEFT JOIN links ON items.id = links.itemID
|
FROM items LEFT JOIN links ON items.id = links.itemID
|
||||||
LEFT JOIN tags ON links.tagID = tags.id
|
LEFT JOIN tags ON links.tagID = tags.id
|
||||||
|
WHERE $typeorlist
|
||||||
GROUP BY items.id;" |
|
GROUP BY items.id;" |
|
||||||
sqlite3 --column $header "${sqliteFile}"
|
sqlite3 --column $header "${sqliteFile}"
|
||||||
}
|
}
|
||||||
|
@ -324,6 +338,7 @@ usage() {
|
||||||
edit [title] Edit a file
|
edit [title] Edit a file
|
||||||
list List all files
|
list List all files
|
||||||
--noheader Don't include the header
|
--noheader Don't include the header
|
||||||
|
--normal List items of type \"normal\"
|
||||||
list-tags Lists tags with the number of times its used
|
list-tags Lists tags with the number of times its used
|
||||||
--noheader Don't include the header
|
--noheader Don't include the header
|
||||||
update <file> [<file>] Updates the database and git repo of a changed file
|
update <file> [<file>] Updates the database and git repo of a changed file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue