summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosmicHorror <CosmicHorrorDev@pm.me>2023-10-02 16:52:13 -0600
committerGitHub <noreply@github.com>2023-10-02 17:52:13 -0500
commit6ee7e7ecd24098295acd7a9f770027c38b3d6b20 (patch)
tree69aaadfc3e5ab0e9e5cc905f3f972446b241b975
parent4ed733834f48de2a8346d3ab5d732a0a80b22533 (diff)
Update generated assets (#235)
-rw-r--r--gen/completions/_sd2
-rw-r--r--gen/completions/_sd.ps14
-rw-r--r--gen/completions/sd.bash2
-rw-r--r--gen/sd.193
4 files changed, 68 insertions, 33 deletions
diff --git a/gen/completions/_sd b/gen/completions/_sd
index b823319..5aade10 100644
--- a/gen/completions/_sd
+++ b/gen/completions/_sd
@@ -29,7 +29,7 @@ _sd() {
'--version[Print version]' \
':find -- The regexp or string (if -s) to search for:' \
':replace_with -- What to replace each match with. Unless in string mode, you may use captured values like $1, $2, etc:' \
-'*::files -- The path to file(s). This is optional - sd can also read from STDIN. {n}{n}Note\: sd modifies files in-place by default. See documentation for examples:_files' \
+'*::files -- The path to file(s). This is optional - sd can also read from STDIN:_files' \
&& ret=0
}
diff --git a/gen/completions/_sd.ps1 b/gen/completions/_sd.ps1
index 1f522b0..01e4658 100644
--- a/gen/completions/_sd.ps1
+++ b/gen/completions/_sd.ps1
@@ -26,12 +26,12 @@ Register-ArgumentCompleter -Native -CommandName 'sd' -ScriptBlock {
[CompletionResult]::new('--flags', 'flags', [CompletionResultType]::ParameterName, 'Regex flags. May be combined (like `-f mc`).')
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Output result into stdout and do not modify files')
[CompletionResult]::new('--preview', 'preview', [CompletionResultType]::ParameterName, 'Output result into stdout and do not modify files')
- [CompletionResult]::new('-F', 'F', [CompletionResultType]::ParameterName, 'Treat FIND and REPLACE_WITH args as literal strings')
+ [CompletionResult]::new('-F', 'F ', [CompletionResultType]::ParameterName, 'Treat FIND and REPLACE_WITH args as literal strings')
[CompletionResult]::new('--fixed-strings', 'fixed-strings', [CompletionResultType]::ParameterName, 'Treat FIND and REPLACE_WITH args as literal strings')
[CompletionResult]::new('-r', 'r', [CompletionResultType]::ParameterName, 'Recursively replace files')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
- [CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
+ [CompletionResult]::new('-V', 'V ', [CompletionResultType]::ParameterName, 'Print version')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
break
}
diff --git a/gen/completions/sd.bash b/gen/completions/sd.bash
index e4dde4e..412f19e 100644
--- a/gen/completions/sd.bash
+++ b/gen/completions/sd.bash
@@ -47,4 +47,4 @@ _sd() {
esac
}
-complete -F _sd -o bashdefault -o default sd
+complete -F _sd -o nosort -o bashdefault -o default sd
diff --git a/gen/sd.1 b/gen/sd.1
index ed72cf0..c5d92ff 100644
--- a/gen/sd.1
+++ b/gen/sd.1
@@ -1,63 +1,98 @@
-.TH SD 1
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.TH sd 1 "sd 0.7.6"
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
.SH NAME
sd
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
.SH SYNOPSIS
-\fBsd\fR [FLAGS] find replace_with [FILES]
-.SH FLAGS
+\fBsd\fR [\fB\-p\fR|\fB\-\-preview\fR] [\fB\-F\fR|\fB\-\-fixed\-strings\fR] [\fB\-r \fR] [\fB\-n \fR] [\fB\-f\fR|\fB\-\-flags\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] <\fIFIND\fR> <\fIREPLACE_WITH\fR> [\fIFILES\fR]
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.SH DESCRIPTION
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.SH OPTIONS
.TP
\fB\-p\fR, \fB\-\-preview\fR
-Emit the replacement to STDOUT
-
+Output result into stdout and do not modify files
.TP
-\fB\-s\fR, \fB\-\-string\-mode\fR
-Treat expressions as non\-regex strings.
-
+\fB\-F\fR, \fB\-\-fixed\-strings\fR
+Treat FIND and REPLACE_WITH args as literal strings
+.TP
+\fB\-r\fR
+Recursively replace files
.TP
-\fB\-f\fR, \fB\-\-flags\fR
+\fB\-n\fR=\fIREPLACEMENTS\fR
+Limit the number of replacements
+.TP
+\fB\-f\fR, \fB\-\-flags\fR=\fIFLAGS\fR
Regex flags. May be combined (like `\-f mc`).
c \- case\-sensitive
+
+e \- disable multi\-line matching
+
i \- case\-insensitive
+
m \- multi\-line matching
-w \- match full words only
-.SH EXIT STATUS
-.TP
-\fB0\fR
-Successful program execution.
+s \- make `.` match newlines
+w \- match full words only
.TP
-\fB1\fR
-Unsuccessful program execution.
-
+\fB\-h\fR, \fB\-\-help\fR
+Print help (see a summary with \*(Aq\-h\*(Aq)
+.TP
+\fB\-V\fR, \fB\-\-version\fR
+Print version
+.TP
+<\fIFIND\fR>
+The regexp or string (if \-s) to search for
.TP
-\fB101\fR
+<\fIREPLACE_WITH\fR>
+What to replace each match with. Unless in string mode, you may use captured values like $1, $2, etc
+.TP
+[\fIFILES\fR]
+The path to file(s). This is optional \- sd can also read from STDIN.
+
+Note: sd modifies files in\-place by default. See documentation for examples.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.SH "EXIT STATUS"
+.IP 0
+Successful program execution.
+.IP 1
+Unsuccessful program execution.
+.IP 101
The program panicked.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
.SH EXAMPLES
.TP
String\-literal mode
-\fB$ echo 'lots((([]))) of special chars' | sd \-s '((([])))' ''\fR
+\fB$ echo \*(Aqlots((([]))) of special chars\*(Aq | sd \-s \*(Aq((([])))\*(Aq\fR
.br
lots of special chars
.TP
-Regex use. Let's trim some trailing whitespace
-\fB$ echo 'lorem ipsum 23 ' | sd '\s+$' ''\fR
+Regex use. Let\*(Aqs trim some trailing whitespace
+\fB$ echo \*(Aqlorem ipsum 23 \*(Aq | sd \*(Aq\\s+$\*(Aq \*(Aq\*(Aq\fR
.br
lorem ipsum 23
.TP
Indexed capture groups
-\fB$ echo 'cargo +nightly watch' | sd '(\w+)\s+\+(\w+)\s+(\w+)' 'cmd: $1, channel: $2, subcmd: $3'\fR
-.br
-cmd: cargo, channel: nightly, subcmd: watch
-.TP
-Named capture groups
-\fB$ echo "123.45" | sd '(?P<dollars>\d+)\.(?P<cents>\d+)' '$dollars dollars and $cents cents'\fR
+\fB$ echo \*(Aqcargo +nightly watch\*(Aq | sd \*(Aq(\\w+)\\s+\\+(\\w+)\\s+(\\w+)\*(Aq \*(Aqcmd: $1, channel: $2, subcmd: $3\*(Aq\fR
.br
123 dollars and 45 cents
.TP
Find & replace in file
-\fB$ sd 'window.fetch' 'fetch' http.js\fR
+\fB$ sd \*(Aqwindow.fetch\*(Aq \*(Aqfetch\*(Aq http.js\fR
+.br
+
.TP
Find & replace from STDIN an emit to STDOUT
-\fB$ sd 'window.fetch' 'fetch' < http.js\fR
+\fB$ sd \*(Aqwindow.fetch\*(Aq \*(Aqfetch\*(Aq < http.js\fR
+.br