Add usage to documentation (#2200)
This commit is contained in:
1 parent
c84e445662
commit
f74cf581b3
6 files changed
+451
-24
No files matched your search
@@ -9,6 +9,7 @@ lf - terminal file manager
|
||||
[**-config** *path*]
|
||||
[**-cpuprofile** *path*]
|
||||
[**-doc**]
|
||||
[**-help**]
|
||||
[**-last-dir-path** *path*]
|
||||
[**-log** *path*]
|
||||
[**-memprofile** *path*]
|
||||
@@ -19,7 +20,6 @@ lf - terminal file manager
|
||||
[**-server**]
|
||||
[**-single**]
|
||||
[**-version**]
|
||||
[**-help**]
|
||||
[*cd-or-select-path*]
|
||||
|
||||
# DESCRIPTION
|
||||
@@ -32,7 +32,113 @@ This documentation can either be read from the terminal using `lf -doc` or onlin
|
||||
You can also use the `help` command (default `<f-1>`) inside lf to view the documentation in a pager.
|
||||
A man page with the same content is also available in the repository at https://github.com/gokcehan/lf/blob/master/lf.1
|
||||
|
||||
You can run `lf -help` to see descriptions of command line options.
|
||||
# OPTIONS
|
||||
|
||||
## POSITIONAL ARGUMENTS
|
||||
|
||||
**cd-or-select-path**
|
||||
|
||||
Set the starting location. If *path* is a directory, start in there. If it's a file, start in the file's parent directory and select the file. When no *path* is supplied, lf uses the current directory. Only accepts one argument.
|
||||
|
||||
## META OPTIONS
|
||||
|
||||
**-doc**
|
||||
|
||||
Show lf's documentation (same content as this file) and exit.
|
||||
|
||||
**-help**
|
||||
|
||||
Show command-line usage and exit.
|
||||
|
||||
**-version**
|
||||
|
||||
Show version information and exit.
|
||||
|
||||
## STARTUP & CONFIGURATION
|
||||
|
||||
**-command** *command*
|
||||
|
||||
Execute *command* during client initialization (i.e. after reading configuration, before `on-init`). To execute more than one command, you can either use the **-command** flag multiple times or pass multiple commands at once by chaining them with ";".
|
||||
|
||||
**-config** *path*
|
||||
|
||||
Use the config file at *path* instead of the normal search locations. This only affects which `lfrc` is read at startup.
|
||||
|
||||
## SHELL INTEGRATION
|
||||
|
||||
**-print-last-dir**
|
||||
|
||||
Print the last directory to stdout when lf exits. This can be used to let lf change your shells working directory. See `CHANGING DIRECTORY` for more details.
|
||||
|
||||
**-last-dir-path** *path*
|
||||
|
||||
Same as **-print-last-dir**, but write the directory to *path* instead of stdout.
|
||||
|
||||
**-print-selection**
|
||||
|
||||
Print selected files to stdout when opening a file in lf. This can be used to use lf as an "open file" dialog. First, select the files you want to pass to another program. Then, confirm the selection by opening a file. This causes lf to quit and print out the selection. Quitting lf prematurely discards the selection.
|
||||
|
||||
**-selection-path** *path*
|
||||
|
||||
Same as **-print-selection**, but write the newline-separated list to *path* instead of stdout.
|
||||
|
||||
## SERVER
|
||||
|
||||
**-remote** *command*
|
||||
|
||||
Send *command* to the running server (e.g. `send`, `query` or `quit`). See `REMOTE COMMANDS` for more details.
|
||||
|
||||
**-server**
|
||||
|
||||
Start the (headless) server process explicitly. Runs in the foreground and writes server logs to stderr (or the file set with **-log**). Clients auto-start a server if none is running unless **-single** is used.
|
||||
|
||||
**-single**
|
||||
|
||||
Start a stand-alone client without a server. Disables remote control.
|
||||
|
||||
## DIAGNOSTICS
|
||||
|
||||
**-log** *path*
|
||||
|
||||
Append runtime log messages to *path*.
|
||||
|
||||
**-cpuprofile** *path*
|
||||
|
||||
Write a CPU profile to *path*. The profile can be used by `go tool pprof`.
|
||||
|
||||
**-memprofile** *path*
|
||||
|
||||
Write a memory profile to *path*. The profile can be used by `go tool pprof`.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
Use `lf` to select files (while hiding certain file types):
|
||||
|
||||
lf -command 'set nohidden' -command 'set hiddenfiles "*mp4:*pdf:*txt"' -print-selection
|
||||
|
||||
Another sophisticated "open file" dialog focusing on design:
|
||||
|
||||
lf -command 'set nopreview; set ratios 1; set drawbox; set promptfmt "Select files [%w] %S q: cancel, l: confirm"' -print-selection
|
||||
|
||||
Open Downloads and set `sortby` and `info` to creation date:
|
||||
|
||||
lf -command 'set sortby btime; set info btime' ~/Downloads
|
||||
|
||||
Temporarily prevent `lf` from modifying the command history:
|
||||
|
||||
lf -command 'set nohistory'
|
||||
|
||||
Use default settings and log current session:
|
||||
|
||||
lf -config /dev/null -log /tmp/lf.log
|
||||
|
||||
Force-quit the server:
|
||||
|
||||
lf -remote 'quit!'
|
||||
|
||||
Inherit lf's working directory in your shell:
|
||||
|
||||
cd "$(lf -print-last-dir)"
|
||||
|
||||
# QUICK REFERENCE
|
||||
|
||||
@@ -721,7 +827,7 @@ Delete the previous word in the backward direction.
|
||||
|
||||
Capitalize/uppercase/lowercase the current word and jump to the next word.
|
||||
|
||||
# OPTIONS
|
||||
# SETTINGS
|
||||
|
||||
This section shows information about options to customize the behavior.
|
||||
Character `:` is used as the separator for list options `[]int` and `[]string`.
|
||||
@@ -1657,8 +1763,12 @@ There is also a `quit` command to quit the server when there are no connected cl
|
||||
lf -remote 'quit'
|
||||
lf -remote 'quit!'
|
||||
|
||||
Lastly, there is a `conn` command to connect the server to a client.
|
||||
This should not be needed for users.
|
||||
Lastly, the commands `conn` and `drop` connect or disconnect ID to/from the server:
|
||||
|
||||
lf -remote 'conn $id'
|
||||
lf -remote 'drop $id'
|
||||
|
||||
These are internal and generally not needed by users.
|
||||
|
||||
# FILE OPERATIONS
|
||||
|
||||
|
||||
Reference in new issue
Block a user