Compare commits
7 commits
1bdc826715
...
a8e818c4dd
Author | SHA1 | Date | |
---|---|---|---|
a8e818c4dd | |||
91784a9d08 | |||
64c1dbcf51 | |||
1541aa6936 | |||
c12a2ce293 | |||
4d0a42ba23 | |||
e4cce2cae4 |
4 changed files with 134 additions and 24 deletions
|
@ -18,12 +18,15 @@ At this time it is not recommended for use this with your production GoToSocial
|
||||||
### Repository mirrors
|
### Repository mirrors
|
||||||
|
|
||||||
Enbas is actively developed in [Code Flow](https://codeflow.dananglin.me.uk/apollo/enbas) with
|
Enbas is actively developed in [Code Flow](https://codeflow.dananglin.me.uk/apollo/enbas) with
|
||||||
the `main` branch mirrored to [Codeberg](https://codeberg.org/dananglin/enbas) and
|
the `main` branch mirrored to the following forges:
|
||||||
[GitHub](https://github.com/dananglin/enbas).
|
|
||||||
|
- **Codeberg**: https://codeberg.org/dananglin/enbas
|
||||||
|
- **Radicle**: https://app.radicle.xyz/nodes/seed.radicle.garden/rad:zhqv2orTvTh2x2d7kYky9NhctrpK
|
||||||
|
- **GitHub**: https://github.com/dananglin/enbas
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
- **[Installation guide](./docs/install.md)**: A guide for installing Enbas on your machine.
|
- **[Installation guide](./docs/installation.md)**: A guide for installing Enbas on your machine.
|
||||||
- **[Getting started guide](./docs/getting_started.md)**: A guide to help you get started on using Enbas.
|
- **[Getting started guide](./docs/getting_started.md)**: A guide to help you get started on using Enbas.
|
||||||
- **[Configuration reference](./docs/configuration.md)**: The configuration reference documentation.
|
- **[Configuration reference](./docs/configuration.md)**: The configuration reference documentation.
|
||||||
- **[User manual](./docs/manual.md)**: The user manual.
|
- **[User manual](./docs/manual.md)**: The user manual.
|
||||||
|
|
134
docs/manual.md
134
docs/manual.md
|
@ -71,8 +71,8 @@ enbas show --type account --my-account
|
||||||
|
|
||||||
### View an account
|
### View an account
|
||||||
|
|
||||||
Print the information of a local or a remote account. If the account is unknown by your instance a `404` message
|
Prints the information of a local or a remote account.
|
||||||
will be returned.
|
If the account is unknown by your instance a `404` message will be returned.
|
||||||
|
|
||||||
```
|
```
|
||||||
enbas show --type account --account-name @name@example.social
|
enbas show --type account --account-name @name@example.social
|
||||||
|
@ -101,8 +101,8 @@ enbas follow --type account --account-name @name@example.social
|
||||||
|
|
||||||
### Unfollow an account
|
### Unfollow an account
|
||||||
|
|
||||||
Unfollow the account that you are following. If you have a pending follow request to the account
|
Unfollow the account that you are following.
|
||||||
in question, unfollowing will remove the follow request.
|
If you have a pending follow request to the account in question, unfollowing will remove the follow request.
|
||||||
|
|
||||||
```
|
```
|
||||||
enbas unfollow --type account --account-name @name@example.social
|
enbas unfollow --type account --account-name @name@example.social
|
||||||
|
@ -145,7 +145,7 @@ enbas show --type blocked
|
||||||
|
|
||||||
| flag | type | required | description | default |
|
| flag | type | required | description | default |
|
||||||
|------|------|----------|-------------|---------|
|
|------|------|----------|-------------|---------|
|
||||||
| `type` | string | true | The resource you want to view. In this case you want `blocked` for blocked accounts. | |
|
| `type` | string | true | The resource you want to view.<br>Here this should be `blocked` for blocked accounts. | |
|
||||||
| `limit` | integer | false | The maximum number of accounts to list. | 20 |
|
| `limit` | integer | false | The maximum number of accounts to list. | 20 |
|
||||||
|
|
||||||
### Mute an account
|
### Mute an account
|
||||||
|
@ -156,10 +156,10 @@ enbas mute --type account --account-name @name@example.social --mute-notificatio
|
||||||
|
|
||||||
| flag | type | required | description | default |
|
| flag | type | required | description | default |
|
||||||
|------|------|----------|-------------|---------|
|
|------|------|----------|-------------|---------|
|
||||||
| `type` | string | true | The resource you want to mute. In this case you want `account`. | |
|
| `type` | string | true | The resource you want to mute.<br>Here this should be `account`. | |
|
||||||
| `account-name` | string | true | The name of the account to mute. | |
|
| `account-name` | string | true | The name of the account to mute. | |
|
||||||
| `mute-notifications` | boolean | false | Set to `true` to mute notifications as well as statuses. | false |
|
| `mute-notifications` | boolean | false | Set to `true` to mute notifications as well as statuses. | false |
|
||||||
| `mute-duration` | string | false | Specify how long the account should be muted for. Set to `0s` to mute indefinitely | 0s (indefinitely) |
|
| `mute-duration` | string | false | Specify how long the account should be muted for.<br>Set to `0s` to mute indefinitely | 0s (indefinitely) |
|
||||||
|
|
||||||
### Unmute an account
|
### Unmute an account
|
||||||
|
|
||||||
|
@ -169,12 +169,12 @@ enbas unmute --type account --account-name @name@example.social
|
||||||
|
|
||||||
| flag | type | required | description | default |
|
| flag | type | required | description | default |
|
||||||
|------|------|----------|-------------|---------|
|
|------|------|----------|-------------|---------|
|
||||||
| `type` | string | true | The resource you want to unmute. In this case you want `account`. | |
|
| `type` | string | true | The resource you want to unmute.<br>Here this should be `account`. | |
|
||||||
| `account-name` | string | true | The name of the account to unmute. | |
|
| `account-name` | string | true | The name of the account to unmute. | |
|
||||||
|
|
||||||
### View muted accounts
|
### View muted accounts
|
||||||
|
|
||||||
Print a list of accounts that you have muted.
|
Prints a list of accounts that you have muted.
|
||||||
|
|
||||||
```
|
```
|
||||||
enbas show --type muted-accounts
|
enbas show --type muted-accounts
|
||||||
|
@ -182,7 +182,7 @@ enbas show --type muted-accounts
|
||||||
|
|
||||||
| flag | type | required | description | default |
|
| flag | type | required | description | default |
|
||||||
|------|------|----------|-------------|---------|
|
|------|------|----------|-------------|---------|
|
||||||
| `type` | string | true | The resource you want to view. In this case you want `muted-accounts`. | |
|
| `type` | string | true | The resource you want to view.<br>Here this should be `muted-accounts`. | |
|
||||||
| `limit` | integer | false | The maximum number of accounts to list. | 20 |
|
| `limit` | integer | false | The maximum number of accounts to list. | 20 |
|
||||||
|
|
||||||
## Statuses
|
## Statuses
|
||||||
|
@ -191,7 +191,9 @@ enbas show --type muted-accounts
|
||||||
|
|
||||||
### Create a status
|
### Create a status
|
||||||
|
|
||||||
### Create a status with a poll
|
- Create a one line status
|
||||||
|
- Create a status from a file
|
||||||
|
- Create a status with a poll
|
||||||
|
|
||||||
### Delete a status
|
### Delete a status
|
||||||
|
|
||||||
|
@ -199,13 +201,19 @@ _Not yet implemented_
|
||||||
|
|
||||||
### Boost (Reblog) a status
|
### Boost (Reblog) a status
|
||||||
|
|
||||||
To boost a status you simply add a 'boost' to it.
|
To boost a status you simply add a `boost` to it.
|
||||||
|
|
||||||
### Un-boost (Un-reblog) a status
|
### Un-boost (Un-reblog) a status
|
||||||
|
|
||||||
To un-boost a status that you've boosted you simply remove the 'boost' from it.
|
To un-boost a status that you've boosted you simply remove the `boost` from it.
|
||||||
|
|
||||||
### Like/Star/Favourite a status
|
### Like a status
|
||||||
|
|
||||||
|
To like (favourite) a status you simply add a `like` or a `star` to it.
|
||||||
|
|
||||||
|
### Unlike a status
|
||||||
|
|
||||||
|
To unlike (un-favourite) a status that you've previously liked you simply remove the `like` or `star` from it.
|
||||||
|
|
||||||
## Polls
|
## Polls
|
||||||
|
|
||||||
|
@ -219,16 +227,110 @@ To un-boost a status that you've boosted you simply remove the 'boost' from it.
|
||||||
|
|
||||||
### Create a list
|
### Create a list
|
||||||
|
|
||||||
|
```
|
||||||
|
enbas create --type list --list-title "My Favourite People" --list-replies-policy list
|
||||||
|
```
|
||||||
|
|
||||||
|
| flag | type | required | description | default |
|
||||||
|
|------|------|----------|-------------|---------|
|
||||||
|
| `type` | string | true | The resource you want to create.<br>Here this should be `list`. | |
|
||||||
|
| `list-title` | string | true | The title of the list that you want to create. | |
|
||||||
|
| `list-replies-policy` | string | false | The policy of the replies for this list.<br>Valid values are `followed`, `list` and `none`. | list |
|
||||||
|
|
||||||
|
### View a list of your lists
|
||||||
|
|
||||||
|
```
|
||||||
|
enbas show --type list
|
||||||
|
```
|
||||||
|
|
||||||
|
| flag | type | required | description | default |
|
||||||
|
|------|------|----------|-------------|---------|
|
||||||
|
| `type` | string | true | The resource you want to view.<br>Here this should be `list`. | |
|
||||||
|
|
||||||
|
### View a specific list
|
||||||
|
|
||||||
|
Prints the information of the specified list to screen along with all the accounts added to it (if any).
|
||||||
|
|
||||||
|
```
|
||||||
|
enbas show --type list --list-id 01J1T9DWR20DC36QWZFKHWZJ3H
|
||||||
|
```
|
||||||
|
|
||||||
|
| flag | type | required | description | default |
|
||||||
|
|------|------|----------|-------------|---------|
|
||||||
|
| `type` | string | true | The resource you want to view.<br>Here this should be `list`. | |
|
||||||
|
| `list-id` | string | false | The ID of the list you want to view. If this is not specified then a list of your lists will be printed instead. | |
|
||||||
|
|
||||||
### Edit a list
|
### Edit a list
|
||||||
|
|
||||||
|
_Potentially a bug here_
|
||||||
|
|
||||||
### Delete a list
|
### Delete a list
|
||||||
|
|
||||||
### Add an account to a list
|
### Add accounts to a list
|
||||||
|
|
||||||
### Remove an account from a list
|
Adds one or more accounts to a list.
|
||||||
|
|
||||||
|
```
|
||||||
|
enbas add --type account --account-name @name@example.social --account-name @person@mastodon.example --to list --list-id 01J1T9DWR20DC36QWZFKHWZJ3H
|
||||||
|
```
|
||||||
|
|
||||||
|
| flag | type | required | description | default |
|
||||||
|
|------|------|----------|-------------|---------|
|
||||||
|
| `type` | string | true | The resource you want to add.<br>Here this should be `account`. | |
|
||||||
|
| `account-name` | string | true | The name of the account you want to add to the list.<br>Use multiple times to specify multiple accounts. | |
|
||||||
|
| `to` | string | true | The resource you want to add the accounts to.<br>Here this should be `list`. | |
|
||||||
|
| `list-id` | string | true | The ID of the list that you want to add the accounts to. | |
|
||||||
|
|
||||||
|
### Remove accounts from a list
|
||||||
|
|
||||||
|
Remove one or more accounts from a list.
|
||||||
|
|
||||||
|
```
|
||||||
|
enbas remove --type account --account-name @person@mastodon.example --from list --list-id 01J1T9DWR20DC36QWZFKHWZJ3H
|
||||||
|
```
|
||||||
|
|
||||||
|
| flag | type | required | description | default |
|
||||||
|
|------|------|----------|-------------|---------|
|
||||||
|
| `type` | string | true | The resource you want to add.<br>Here this should be `account`. | |
|
||||||
|
| `account-name` | string | true | The name of the account you want to remove from the list.<br>Use multiple times to specify multiple accounts. | |
|
||||||
|
| `to` | string | true | The resource you want to remove the accounts from.<br>Here this should be `list`. | |
|
||||||
|
| `list-id` | string | true | The ID of the list that you want to remove the accounts from. | |
|
||||||
|
|
||||||
## Bookmarks
|
## Bookmarks
|
||||||
|
|
||||||
|
### View your bookmarks
|
||||||
|
|
||||||
|
Prints a list of statuses that you have bookmarked.
|
||||||
|
|
||||||
|
```
|
||||||
|
enbas show --type bookmarks
|
||||||
|
```
|
||||||
|
|
||||||
|
| flag | type | required | description | default |
|
||||||
|
|------|------|----------|-------------|---------|
|
||||||
|
| `type` | string | true | The resource you want to view.<br>Here this should be `bookmarks`. | |
|
||||||
|
| `limit` | integer | false | The maximum number of bookmarks to show. | 20 |
|
||||||
|
|
||||||
### Add a status to your bookmarks
|
### Add a status to your bookmarks
|
||||||
|
|
||||||
|
```
|
||||||
|
enbas add --type status --status-id 01J17FH1KD9CN6J9Q01011NE0D --to bookmarks
|
||||||
|
```
|
||||||
|
|
||||||
|
| flag | type | required | description | default |
|
||||||
|
|------|------|----------|-------------|---------|
|
||||||
|
| `type` | string | true | The resource you want to add.<br>Here this should be `status`. | |
|
||||||
|
| `status-id` | string | true | The ID of the status. | |
|
||||||
|
| `to` | string | true | The resource you want to add the status to.<br>Here this should be `bookmarks`. | |
|
||||||
|
|
||||||
### Remove a status from your bookmarks
|
### Remove a status from your bookmarks
|
||||||
|
|
||||||
|
```
|
||||||
|
enbas remove --type status --status-id 01J17FH1KD9CN6J9Q01011NE0D --from bookmarks
|
||||||
|
```
|
||||||
|
|
||||||
|
| flag | type | required | description | default |
|
||||||
|
|------|------|----------|-------------|---------|
|
||||||
|
| `type` | string | true | The resource you want to remove.<br>Here this should be `status`. | |
|
||||||
|
| `status-id` | string | true | The ID of the status. | |
|
||||||
|
| `from` | string | true | The resource you want to remove the status to.<br>Here this should be `bookmarks`. | |
|
||||||
|
|
|
@ -7,6 +7,7 @@ package executor
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"codeflow.dananglin.me.uk/apollo/enbas/internal/client"
|
"codeflow.dananglin.me.uk/apollo/enbas/internal/client"
|
||||||
"codeflow.dananglin.me.uk/apollo/enbas/internal/config"
|
"codeflow.dananglin.me.uk/apollo/enbas/internal/config"
|
||||||
|
@ -26,12 +27,15 @@ type MuteOrUnmuteExecutor struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMuteOrUnmuteExecutor(printer *printer.Printer, config *config.Config, name, summary string) *MuteOrUnmuteExecutor {
|
func NewMuteOrUnmuteExecutor(printer *printer.Printer, config *config.Config, name, summary string) *MuteOrUnmuteExecutor {
|
||||||
|
muteDuration := TimeDurationFlagValue{time.Duration(0 * time.Second)}
|
||||||
|
|
||||||
exe := MuteOrUnmuteExecutor{
|
exe := MuteOrUnmuteExecutor{
|
||||||
FlagSet: flag.NewFlagSet(name, flag.ExitOnError),
|
FlagSet: flag.NewFlagSet(name, flag.ExitOnError),
|
||||||
|
|
||||||
printer: printer,
|
printer: printer,
|
||||||
config: config,
|
config: config,
|
||||||
command: name,
|
command: name,
|
||||||
|
muteDuration: muteDuration,
|
||||||
}
|
}
|
||||||
|
|
||||||
exe.StringVar(&exe.accountName, flagAccountName, "", "Specify the account name in full (username@domain)")
|
exe.StringVar(&exe.accountName, flagAccountName, "", "Specify the account name in full (username@domain)")
|
||||||
|
|
|
@ -16,16 +16,17 @@ type SwitchExecutor struct {
|
||||||
*flag.FlagSet
|
*flag.FlagSet
|
||||||
|
|
||||||
config *config.Config
|
config *config.Config
|
||||||
|
printer *printer.Printer
|
||||||
toResourceType string
|
toResourceType string
|
||||||
accountName string
|
accountName string
|
||||||
printer *printer.Printer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSwitchExecutor(printer *printer.Printer, config *config.Config, name, summary string) *SwitchExecutor {
|
func NewSwitchExecutor(printer *printer.Printer, config *config.Config, name, summary string) *SwitchExecutor {
|
||||||
switchExe := SwitchExecutor{
|
switchExe := SwitchExecutor{
|
||||||
FlagSet: flag.NewFlagSet(name, flag.ExitOnError),
|
FlagSet: flag.NewFlagSet(name, flag.ExitOnError),
|
||||||
printer: printer,
|
|
||||||
config: config,
|
config: config,
|
||||||
|
printer: printer,
|
||||||
}
|
}
|
||||||
|
|
||||||
switchExe.StringVar(&switchExe.toResourceType, flagTo, "", "The account to switch to")
|
switchExe.StringVar(&switchExe.toResourceType, flagTo, "", "The account to switch to")
|
||||||
|
|
Loading…
Reference in a new issue