mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
ability to specify command when hitting enter (#1223)
* ability to specify command when hitting enter * documentation * man page * generate man page and html * run default command through same logic as other commands impetuous: persist return val for display in promt if non-zero also future-proofs for other benefits / DRYness. no need for another eval invocation. * fix generated manpage
This commit is contained in:
parent
b9bd309a87
commit
6ed2643252
|
|
@ -392,13 +392,20 @@ Type `exit`, `quit`, or `q` to end the repl session.
|
|||
Any arguments to git repl will be taken as the first command to execute in
|
||||
the repl.
|
||||
|
||||
You can specify a default command to run when hitting enter:
|
||||
|
||||
```bash
|
||||
git config --global git-extras.repl.on-enter-command "git status -sb"
|
||||
```
|
||||
|
||||
You can configure which character is used at the end of the prompt: (default `>`):
|
||||
|
||||
```bash
|
||||
git config --global git-extras.repl.prompt-character "±"
|
||||
```
|
||||
|
||||
You can specify the prefix for the prompt (default `git`):
|
||||
You can specify the prefix for the prompt, or remove it (default `git`):
|
||||
|
||||
```bash
|
||||
git config --global git-extras.repl.prefix ""
|
||||
```
|
||||
|
|
|
|||
|
|
@ -52,7 +52,14 @@ while true; do
|
|||
# Built-in commands
|
||||
case $cmd in
|
||||
ls) cmd=ls-files;;
|
||||
"") continue;;
|
||||
"")
|
||||
on_enter_cmd=$(git config --get --default '' git-extras.repl.on-enter-command)
|
||||
if test -n "$on_enter_cmd"; then
|
||||
cmd="$on_enter_cmd"
|
||||
else
|
||||
continue
|
||||
fi
|
||||
;;
|
||||
quit|exit|q) break;;
|
||||
esac
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ exit|quit|q
|
|||
.P
|
||||
Ends the repl session\.
|
||||
.SH "CONFIGURATION"
|
||||
You can specify a default command to run when hitting enter:
|
||||
.P
|
||||
\fBgit config \-\-global git\-extras\.repl\.on\-enter\-command "git status \-sb"\fR
|
||||
.P
|
||||
You can configure which character is used at the end of the prompt (default \fB>\fR):
|
||||
.P
|
||||
\fBgit config \-\-global git\-extras\.repl\.prompt\-character "±"\fR
|
||||
|
|
|
|||
|
|
@ -115,6 +115,10 @@
|
|||
|
||||
<h2 id="CONFIGURATION">CONFIGURATION</h2>
|
||||
|
||||
<p>You can specify a default command to run when hitting enter:</p>
|
||||
|
||||
<p><code>git config --global git-extras.repl.on-enter-command "git status -sb"</code></p>
|
||||
|
||||
<p>You can configure which character is used at the end of the prompt
|
||||
(default <code>></code>):</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ git-repl(1) -- git read-eval-print-loop
|
|||
|
||||
## CONFIGURATION
|
||||
|
||||
You can specify a default command to run when hitting enter:
|
||||
|
||||
`git config --global git-extras.repl.on-enter-command "git status -sb"`
|
||||
|
||||
You can configure which character is used at the end of the prompt
|
||||
(default `>`):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue