-
Notifications
You must be signed in to change notification settings - Fork 0
/
jet.1
90 lines (70 loc) · 2.69 KB
/
jet.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.\" Manpage for jet.
.\" For bug reports, contact [email protected].
.TH jet 1 "2023-10-18" "jet man page"
.SH NAME
jet \- Just Edit Text
.SH SYNOPSIS
.B jet [OPTIONS] pattern replacement input-files...
.br
.B jet [OPTIONS] -e pattern1 replacement1 -e pattern2 replacement2 input-files...
.SH DESCRIPTION
Jet is a fast and intuitive command-line tool for find and replace operations.
.P
It replaces all occurrences of the specified regular expression patterns with the provided replacement text.
.P
Jet can process single files or entire directories specified on the command line.
.P
When given a directory, Jet descends into the directory tree and recursively finds and replaces matches in all files.
.SH OPTIONS
.TP
.B \-p
Print to stdout instead of modifying files.
.TP
.B \-v
Enable verbose mode; explain what is being done.
.TP
.B \-g \fIglob-pattern\fR
Only process files matching the given glob pattern.
.TP
.B \-a
Include hidden files (those starting with a dot).
.TP
.B \-l \fIint\fR
Maximum depth for directory traversal.
.TP
.B \-r\fR, \fB\-\-replace\-names
Replace matches in file and directory names.
.TP
.B \-n\fR, \fB\-\-names\-only
Only replace matching names, ignoring file contents.
.TP
.B \-e \fIpattern replacement\fR
Specify a regular expression pattern and replacement.
Can be used multiple times for multiple replacements.
.TP
.B \-h\fR, \fB\-\-help
Prints this help message and exits.
.SH NOTICE
When using the \-e flag multiple times, the pattern-replacement pairs are executed in the same order they are specified, one by one.
.SH EXAMPLES
.TP
.B jet "foo" "bar" my/path1 my/path2
Replace all occurrences of "foo" with "bar" in the files under \fImy/path1\fR and \fImy/path2\fR.
.TP
.B jet \-e "foo" "bar" \-e "baz" "qux" my/path1 my/path2
Replace all occurrences of "foo" with "bar" and "baz" with "qux" in the files under \fImy/path1\fR and \fImy/path2\fR.
.TP
.B jet \-p \-v "foo" "bar" my/path1
Replace "foo" with "bar" in \fImy/path1\fR and print the results to stdout with verbose output.
.TP
.B jet \-n "foo" "bar" my/path1
Rename files and directories by replacing "foo" with "bar" in their names under \fImy/path1\fR, without modifying file contents.
.TP
.B jet \-e "foo" "bar" \-e "baz" "qux" \-g "*.txt" \-a my/path1
Replace "foo" with "bar" and "baz" with "qux" in all text files, including hidden files, under \fImy/path1\fR.
.SH COPYRIGHT
Jet Copyright (C) 2023 Nicolò Santamaria
This program comes with ABSOLUTELY NO WARRANTY; for details refer to https://www.gnu.org/licenses/gpl-3.0.html.
This is free software, and you are welcome to change and redistribute it under the conditions defined by the license.
.SH AUTHOR
Written by Nicolò Santamaria <[email protected]>.