-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterject.roff
More file actions
77 lines (77 loc) · 2.49 KB
/
interject.roff
File metadata and controls
77 lines (77 loc) · 2.49 KB
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
.\" Manpage for interject.
.TH INTERJECT "1" "April 2019" "interject 1.0.0" "User Commands"
.SH NAME
\fBinterject\fP \- Inspect and edit the contents of a pipe
.SH SYNOPSIS
command1 | \fBinterject\fP [\fB-n\fP] [\fB-e <EDITOR>\fP] [\fB-t <TEMPDIR>\fP] | command2
.SH DESCRIPTION
.B interject(1)
is a tool for inspecting the contents of a pipe with an editor.
This is particularly useful in the case where you plan on piping a script retrieved by
.BR curl(1)
into a shell directly.
.B interject(1)
is an alternative to
.BR vipe(1)
that allows the user to control the tool with flags, in addition to environment variables.
.SH ENVIRONMENT VARIABLES
.TP
.B EDITOR
If the
.B \-e
option is not used,
.B interject(1)
will use the editor set in this environment variable.
If the variable is unset,
.B interject(1)
will default to using
.BR vim(1)
.PP
.TP
.B TEMPDIR
If the
.B \-t
option is not used,
.B interject(1)
will use a temporary directory set in this environment variable.
If the variable is unset, the temporary directory used will default to
.I /tmp
.SH OPTIONS
.TP
.BR \-n
Don't wait for the input command to complete before opening the editor.
With this command you can reload the file in \fBvim(1)\fP with \fB:e!\fP or \fB:checktime\fP.
.TP
.BR \-e " " <EDITOR>
Set the editor used to view the pipe to \fB<EDITOR>\fP.
.PP
.TP
.BR \-t " " <TEMPDIR>
Set the temporary directory to \fB<TEMPDIR>\fP.
.SH EXAMPLES
.TP
command1 | interject -e emacs | command2
Pipe the contents of \fBcommand1\fP into a temporary file, then read that file with \fBemacs(1)\fP; if \fBemacs(1)\fP closes without an error code, pipe the input into \fBcommand2\fP.
.TP
command1 | interject -t /temp_dir | command2
Use the temporary directory \fI/temp_dir/\fP instead of \fI/tmp/\fP or \fBTEMPDIR\fP.
.TP
curl www.example.com | interject | bash
Capture the output of \fBcurl(1)\fP, then edit it in the default \fBEDITOR\fP; if there are no problems, run the pipe as a script using \fBbash(1)\fP.
.TP
curl www.example.com/big | interject -n | bash
Don't wait for the \fBcurl(1)\fP command to complete before opening up the editor.
.TP
interject -h
Display the usage info for \fBinterject(1)\fP.
.SH SEE ALSO
.BR vipe(1)
.SH AUTHOR
Elliott Indiran <elliott.indiran@protonmail.com>
.SH BUGS
Report bugs here: \fIhttps://github.com/eindiran/interject\fP
.SH COPYRIGHT
Copyright © 2019 Elliott Indiran.
License: MIT <https://mit-license.org/>
This is free software: you are free to make changes to it for any purpose.
There is \fBNO WARRANTY\fP, to the extent permitted by law.