Skip to content

Commit

Permalink
dump command help
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Nov 7, 2022
1 parent 8061e1d commit 17ced3e
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 19 deletions.
75 changes: 75 additions & 0 deletions cmd/slackdump/internal/dump/assets/dump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Command Dump

## Description

Dump is the mode that allows to dump the following type of conversations:

- public and private channels with threads
- group messages (MPIM)
- private messages (DMs)
- individual threads

It downloads file attachments as well, if the `-download` flag is set.

This is the original low-level mode that applies almost no transformations to
the API output mode of the Slackdump, and its behaviour would be familiar
to those who used it since the very first release.

### IDs or URLs Parameter

The `<IDs or URLs>` parameter should list the IDs of conversations or URLs of
the channel or thread that you'd like to download, for example `C051D4052` is
a channel ID, and `https://ora600.slack.com/archives/DHYNUJ00Y` is a URL of a
private conversation (DM). You can also use an input file with the list of
IDs or URLs or combine file with conversations and individual conversation
links.

## Examples

### Dump one channel and a DM

This command will also enable file download.

```shell
slackdump dump -files C051D4052 DHYNUJ00Y
```

### Dump channels listed in my_channels.txt

```shell
slackdump dump @my_channels.txt
```

### Dump a single thread

Threads can be specified as a **URL**, or use a Slackdump-specific
**colon notation**.

URL:

```shell
slackdump dump \
https://ora600.slack.com/archives/C051D4052/p1665917454731419
```

Slackdump colon notation:

```shell
slackdump dump C051D4052:1665917454.731419
```

### Combined all of the above

This example shows how you can combine different types of input. URL of the
thread is omitted for brevity:

```shell
slackdump dump -files C051D4052 \
DHYNUJ00Y \
@my_channels.txt \
C051D4052:1665917454.731419
```

_Windows users_: please note that "\" is used on UNIX systems to split the
single command across multiple lines. The same command can be entered on a
single line without "\" and will have the same effect as the one above.
29 changes: 10 additions & 19 deletions cmd/slackdump/internal/dump/dump.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
package dump

import "github.com/rusq/slackdump/v2/cmd/slackdump/internal/golang/base"
import (
_ "embed"

var CmdDump = &base.Command{
UsageLine: "slackdump dump [flags] <ids or urls>",
Short: "dump individual conversations or threads",
Long: base.Render(`
# Command Dump
Dump is the mode that allows to dump the following type of conversations:
- public and private channels with threads
- group messages (MPIM)
- private messages (DMs)
- individual threads
"github.com/rusq/slackdump/v2/cmd/slackdump/internal/golang/base"
)

It downloads file attachments as well.
//go:embed assets/dump.md
var dumpLong string

This is the original mode of the Slackdump, so its behaviour would be familiar
to those who used it since the first release.
It can be considered as a low level mode, as there are no transformations, and
it is directly calling Slackdump library functions.
`),
var CmdDump = &base.Command{
UsageLine: "slackdump dump [flags] <IDs or URLs>",
Short: "dump individual conversations or threads",
Long: base.Render(dumpLong),
}
2 changes: 2 additions & 0 deletions cmd/slackdump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/rusq/slackdump/v2/cmd/slackdump/internal/apiconfig"
"github.com/rusq/slackdump/v2/cmd/slackdump/internal/cfg"
"github.com/rusq/slackdump/v2/cmd/slackdump/internal/diag"
"github.com/rusq/slackdump/v2/cmd/slackdump/internal/dump"
"github.com/rusq/slackdump/v2/cmd/slackdump/internal/emoji"
"github.com/rusq/slackdump/v2/cmd/slackdump/internal/export"
"github.com/rusq/slackdump/v2/cmd/slackdump/internal/golang/base"
Expand All @@ -36,6 +37,7 @@ func init() {
base.Slackdump.Commands = []*base.Command{
wizard.CmdWizard,
export.CmdExport,
dump.CmdDump,
list.CmdList,
emoji.CmdEmoji,
workspace.CmdWorkspace,
Expand Down

0 comments on commit 17ced3e

Please sign in to comment.