File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ fn main() -> Result<(), GeneralError> {
108
108
clap:: arg!( -c --"in-cwd" [ IN_CWD ] "filters by paths in the current working directory" ) ,
109
109
clap:: arg!( [ TAGS ] ) ,
110
110
] ) )
111
+ . subcommand ( Command :: new ( "tags" ) . about ( "Get a list of all tags" ) )
111
112
. get_matches ( ) ;
112
113
113
114
match matches. subcommand ( ) {
@@ -123,6 +124,14 @@ fn main() -> Result<(), GeneralError> {
123
124
. unwrap_or_else ( |_| sub_matches. is_present ( "in-cwd" ) ) ;
124
125
find_path ( connection, & tags, in_cwd) ?;
125
126
}
127
+ Some ( ( "tags" , _) ) => {
128
+ let mut statement = connection. prepare ( "SELECT DISTINCT tag FROM tagged;" ) ?;
129
+ let rows = statement. query_map ( [ ] , |row| row. get :: < usize , String > ( 0 ) ) ?;
130
+
131
+ for row in rows {
132
+ println ! ( "{}" , row?) ;
133
+ }
134
+ }
126
135
_ => unreachable ! ( "Exhausted list of subcommands and subcommand_required prevents `None`" ) ,
127
136
} ;
128
137
You can’t perform that action at this time.
0 commit comments