Export count as a variable when running commands (#1187)
This commit is contained in:
1 parent
f563263add
commit
3ae67fc361
4 files changed
+19
No files matched your search
@@ -186,6 +186,7 @@ The following environment variables are exported for shell commands:
|
||||
lf_user_{option}
|
||||
lf_width
|
||||
lf_height
|
||||
lf_count
|
||||
|
||||
The following special shell commands are used to customize the behavior of lf when defined:
|
||||
|
||||
@@ -959,6 +960,10 @@ Value of the user_{option}.
|
||||
|
||||
Width/Height of the terminal.
|
||||
|
||||
lf_count
|
||||
|
||||
Value of the count associated with the current command.
|
||||
|
||||
# Special Commands
|
||||
|
||||
This section shows information about special shell commands.
|
||||
|
||||
@@ -189,6 +189,7 @@ The following environment variables are exported for shell commands:
|
||||
lf_user_{option}
|
||||
lf_width
|
||||
lf_height
|
||||
lf_count
|
||||
|
||||
The following special shell commands are used to customize the behavior of lf
|
||||
when defined:
|
||||
@@ -1026,6 +1027,10 @@ Value of the user_{option}.
|
||||
|
||||
Width/Height of the terminal.
|
||||
|
||||
lf_count
|
||||
|
||||
Value of the count associated with the current command.
|
||||
|
||||
# Special Commands
|
||||
|
||||
This section shows information about special shell commands.
|
||||
|
||||
@@ -1263,6 +1263,8 @@ func insert(app *app, arg string) {
|
||||
}
|
||||
|
||||
func (e *callExpr) eval(app *app, args []string) {
|
||||
os.Setenv("lf_count", strconv.Itoa(e.count))
|
||||
|
||||
switch e.name {
|
||||
case "up":
|
||||
if !app.nav.init {
|
||||
|
||||
@@ -207,6 +207,7 @@ The following environment variables are exported for shell commands:
|
||||
lf_user_{option}
|
||||
lf_width
|
||||
lf_height
|
||||
lf_count
|
||||
.EE
|
||||
.PP
|
||||
The following special shell commands are used to customize the behavior of lf when defined:
|
||||
@@ -1167,6 +1168,12 @@ Value of the user_{option}.
|
||||
.EE
|
||||
.PP
|
||||
Width/Height of the terminal.
|
||||
.PP
|
||||
.EX
|
||||
lf_count
|
||||
.EE
|
||||
.PP
|
||||
Value of the count associated with the current command.
|
||||
.SH SPECIAL COMMANDS
|
||||
This section shows information about special shell commands.
|
||||
.PP
|
||||
|
||||
Reference in new issue
Block a user