@@ -19,7 +19,7 @@ def main():
1919 """
2020
2121
22- @main .command (help = "Update database once, searches for all directories recursively." )
22+ @main .command ()
2323@click .argument ("path" , required = True , type = click .Path (exists = True ))
2424@click .option (
2525 "--db-path" ,
@@ -34,16 +34,11 @@ def main():
3434def batch (path , db_path , exclude_regex , verbose ):
3535 """
3636 Update database once, searches for all directories recursively.
37-
38- :param path: path to scan in batch mode recursively
39- :param db_path: path to the database
40- :param exclude_regex: exclue file paths matching this regex
41- :param verbose: enable verbose logging
4237 """
4338 scan .batch (path , db_path , exclude_regex , verbose )
4439
4540
46- @main .command (help = "Update database continiously, watches for new or changed files." )
41+ @main .command ()
4742@click .argument ("path" , required = True , type = click .Path (exists = True ))
4843@click .option (
4944 "--db-path" ,
@@ -54,15 +49,11 @@ def batch(path, db_path, exclude_regex, verbose):
5449def watch (path , db_path , verbose ):
5550 """
5651 Update database continiously, watches for new or changed files.
57-
58- :param path: path to watch recursively
59- :param db_path: path to the database
60- :param verbose: enable verbose logging
6152 """
6253 scan .watch (path , db_path , verbose )
6354
6455
65- @main .command (help = "Get traits of a given path" )
56+ @main .command ()
6657@click .argument ("path" , required = True , type = click .Path (exists = True ))
6758@click .option (
6859 "--db-path" ,
@@ -73,13 +64,29 @@ def watch(path, db_path, verbose):
7364def get (path , db_path , verbose ):
7465 """
7566 Get traits of a given path
76-
77- :param path: path to get traits for
78- :param db_path: path to the database
79- :param verbose: enable verbose logging
8067 """
8168 access .get (path , db_path , verbose )
8269
8370
71+ @main .command ()
72+ @click .argument ("query_str" , required = True )
73+ @click .option (
74+ "--db-path" ,
75+ default = DB_PATH ,
76+ type = click .Path (file_okay = True , dir_okay = False ),
77+ )
78+ @click .option (
79+ "--show-values" , flag_value = True , default = False , help = "Also show their trait values"
80+ )
81+ def query (query_str , db_path , show_values ):
82+ """
83+ Get paths of given traits
84+
85+ Enter QUERY_STR in SQLite3 where statement format,
86+ e.g. "[score/REAL]>1" to get all paths having a score >1.
87+ """
88+ access .query (query_str , db_path , show_values )
89+
90+
8491if __name__ == "__main__" :
8592 main ()
0 commit comments