Skip to content

Commit

Permalink
doc update: flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed May 18, 2023
1 parent 4e6ce0a commit 90a3c3f
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 2 deletions.
9 changes: 8 additions & 1 deletion cmd/slackdump/internal/cfg/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ var (
Browser browser.Browser
Limits = slackdump.DefLimits

DumpFiles bool
DumpFiles bool
NoChunkCache bool

// Oldest is the default timestamp of the oldest message to fetch, that is
// used by the dump and export commands.
Expand Down Expand Up @@ -62,6 +63,7 @@ const (
OmitWorkspaceFlag
OmitUserCacheFlag
OmitTimeframeFlag
OmitChunkCacheFlag

OmitAll = OmitConfigFlag |
OmitDownloadFlag |
Expand Down Expand Up @@ -111,6 +113,11 @@ func SetBaseFlags(fs *flag.FlagSet, mask FlagMask) {
fs.BoolVar(&NoUserCache, "no-user-cache", false, "disable user cache (file cache)")
fs.DurationVar(&UserCacheRetention, "user-cache-retention", 60*time.Minute, "user cache retention duration. After this time, the cache is considered stale and will be refreshed.")
}
if mask&OmitChunkCacheFlag == 0 {
// ChunkCache can decrease the time of conversion for the archives
// with large channels. Caching is pretty useless for small archives.
fs.BoolVar(&NoChunkCache, "no-chunk-cache", false, "disable chunk cache (uses temporary directory)")
}
if mask&OmitTimeframeFlag == 0 {
fs.Var(&Oldest, "time-from", "timestamp of the oldest message to fetch (UTC timezone)")
fs.Var(&Latest, "time-to", "timestamp of the newest message to fetch (UTC timezone)")
Expand Down
81 changes: 80 additions & 1 deletion slackdump.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.\" https://man.openbsd.org/mdoc.7
.Dd $Mdocdate$
.Dt SLACKDUMP 1
Expand Down Expand Up @@ -88,6 +87,86 @@ Display version information.
Manage Slack workspaces authentication.
.El
.\"
.Sh FLAGS
This section lists all available flags, availability of which depends on the
command. The flags are listed in alphabetical order.
.Bl -tag -width -base dir
.It Fl api-config Ar path
Use the specified API limits configuration file (see the
.Cm config
command).
.It Fl base Ar path
Specifies the base directory or zip file where all data will be stored.
If the path ends with
.Dq .zip ,
the data will be stored in the zip file, otherwise
it will be stored in the directory.
.Pp
If the flag is not specified, Slackdump defaults to creating a zip file in the
current directory using the following pattern:
.Dq slackdump_YYYYMMDD_HHMISS.zip ,
where
.Dq YYYYMMDD_HHMISS
is the current date and time. For example:
.Bd -literal -offset indent
slackdump_20201231_235959.zip
.Ed
.It Fl browser Ar firefox | chromium
Specifies the browser to use for the authentication. The default is Firefox.
.It Fl cache-dir Ar path
Specifies the directory where the authentication information and user/channel
cache is stored. If the flag is not specified, the cache is stored in the
system cache directory.
.It Fl cookie Ar cookie | cookie_file
.It Fl files=true|false
Enables or disables attachment files downloading. The default is enabled. To
disable downloading, use
.Dq Fl files=false .
.It Fl log Ar path
Specifies the log file path. If the flag is not specified, the log is written
to the standard output.
.It Fl token Ar token
Specifies the token to use for the authentication. This flag is only used
with the manual authentication methods.
.It Fl no-user-cache
Disables caching of users for the subcommands of the
.Cm list
command.
.It Fl no-chunk-cache
Disables caching of chunks for the
.Cm convert
command. This may be useful on small archives. For big archives caching is
beneficial, as it allows to reduce the processing time.
.It Fl time-from Ar YYYY-MM-DDTHH:MI:SS
Allows to specify the start time. The time is specified in the format
.Dq YYYY-MM-DDTHH:MI:SS
where
.Sq T
is a literal character separating the date and time, for example
.Dq 2020-12-311T23:59:59
.It Fl time-to Ar YYYY-MM-DDTHH:MI:SS
Allows to specify the end time. See the
.Fl time-from
flag for the format.
.It Fl trace Ar filename
Enables tracing and writes the trace to the specified file.
.It Fl user-cache-retention Ar duration
Specifies the duration for which the user cache is kept. The default is
.Dq 1h
.Ns .
The duration is specified in the format accepted by the Go time package.
For example, to specify the duration of 1 hour 30 minutes and 55 seconds, use
.Dq 1h30m55s
.Ns .
.It Fl v
Enables verbose output, prints a lot of debugging information.
.It Fl workspace Ar name
Allows to override the currently selected workspace for the session.
See also the
.Cm workspace Ar select
command.
.El
.\"
.Sh USAGE
.Ss Quickstart
The quickest way to get started is to run the following command:
Expand Down

0 comments on commit 90a3c3f

Please sign in to comment.