Skip to content

Commit

Permalink
docs: update about auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuheiKubota committed Aug 25, 2022
1 parent bff285d commit 16c7c48
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ manipulate files in Slack

* List
* Delete
* Uniq (delete duplicated files)
* Uniq (delete duplicate files)
* Upload

# Usage
Expand All @@ -17,7 +17,7 @@ Sub commands:
auth authenticate
delete, remove, del, rm delete files
list, ls list files
uniq delete duplicated files
uniq delete duplicate files
Options:
--config (default: ./slack-file.conf)
Expand Down Expand Up @@ -94,8 +94,10 @@ Global Options:
Usage:
1. go to https://api.slack.com/apps
2. make a new app (files:read, files:write)
3. slack-file slack auth CLIENT_ID CLIENT_SECRET
2. make a new app
Redirect URLs: https://localhost:7878
Scopes: files:read, files:write
3. slack-file-uniq slack auth CLIENT_ID CLIENT_SECRET
```

## List
Expand Down Expand Up @@ -153,7 +155,7 @@ Usage:
## Uniq

```
command uniq - delete duplicated files
command uniq - delete duplicate files
Options:
--key a unique key set of files (default: Name,Title)
Expand All @@ -165,7 +167,7 @@ Global Options:
--config (default: ./slack-file.conf)
Usage:
# SIMULATE delete duplicated files by Name, keep newest Timestamp
# SIMULATE delete duplicate files by Name, keep newest Timestamp
slack-file uniq --key Name --sort -Timestamp --dry-run
# DELETE
slack-file uniq --key Name --sort -Timestamp
Expand Down
2 changes: 1 addition & 1 deletion cmd_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func init() {
}

type authCmd struct {
_ struct{} `help:"authenticate" usage:"1. go to https://api.slack.com/apps\n2. make a new app (files:read, files:write)\n3. slack-file-uniq slack auth CLIENT_ID CLIENT_SECRET"`
_ struct{} `help:"authenticate" usage:"1. go to https://api.slack.com/apps\n2. make a new app\n\tRedirect URLs: https://localhost:7878\n\tScopes: files:read, files:write\n3. slack-file-uniq slack auth CLIENT_ID CLIENT_SECRET"`

Port int `cli:"port=PORT" default:"7878" help:"a temporal PORT for OAuth authentication."`
Timeout int `cli:"timeout=TIMEOUT" default:"60" help:"set TIMEOUT (in seconds) on authentication transaction. < 0 is infinite."`
Expand Down
2 changes: 1 addition & 1 deletion cmd_uniq.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func fileString(f slack.File) string {
}

type uniqCmd struct {
_ struct{} `help:"delete duplicated files" usage:"# SIMULATE delete duplicated files by Name, keep newest Timestamp\nslack-file uniq --key Name --sort -Timestamp --dry-run\n# DELETE\nslack-file uniq --key Name --sort -Timestamp"`
_ struct{} `help:"delete duplicate files" usage:"# SIMULATE delete duplicate files by Name, keep newest Timestamp\nslack-file uniq --key Name --sort -Timestamp --dry-run\n# DELETE\nslack-file uniq --key Name --sort -Timestamp"`

Key gli.StrList `default:"Name,Title" help:"a unique key set of files"`
Sort gli.StrList `default:"-Created,-Timestamp,ID" help:"sort fields of each --key group"`
Expand Down

0 comments on commit 16c7c48

Please sign in to comment.