Skip to content

Commit 7898fb6

Browse files
authored
docs: add a README (#18)
1 parent aa76c16 commit 7898fb6

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Tag
2+
3+
A simple program to organize plain text files with tags.
4+
5+
## Installation
6+
7+
### As a binary
8+
9+
Simply head to the [releases](https://github.com/miampf/tag/releases) page and download the latest release for your system.
10+
11+
### From source
12+
13+
Simply clone the repository and run `cargo build --release` to build the project.
14+
15+
## Usage
16+
17+
To use tag you must add a taglist as the first line of your text files. A tagline looks like the following:
18+
19+
```
20+
tags: [#tag1 #tag2]
21+
```
22+
23+
The tags in the tagline start with a `#` followed by letters (some none-ASCII letters are also supported), numbers, `_` and `-`. This tagline **must** be the first line of your file and **must not** be larger than one line. You can find the tagline grammar under [tagline.pest](./tagline.pest).
24+
25+
Once you've added taglines to your local files you can run `tag`. `tag` will search all subdirectories of a given directory and check if tagged files match your search query.
26+
27+
The `tag` help message:
28+
29+
```
30+
Usage: tag [OPTIONS] <QUERY> <PATH>
31+
32+
Arguments:
33+
<QUERY> Search query for the tags
34+
<PATH> The path that will be searched
35+
36+
Options:
37+
-s, --silent Only print the paths of matched files
38+
-h, --help Print help
39+
-V, --version Print version
40+
```
41+
42+
A query contains operators and tags. Usable operators are `&` for the logical AND, `|` for the logical OR and `!` as a unary NOT. Furthermore, you can nest queries by using parantheses. A query could look like this:
43+
44+
```
45+
#tag1 & #tag2 | (!#tag3 & #tag4)
46+
```
47+
48+
This query would match all files that contain `#tag1` AND `#tag2` OR files that don't contain `#tag3` while also containing `#tag4`. You can find the query grammar under [query.pest](./query.pest).

0 commit comments

Comments
 (0)