- Created generic Error types to remove the need to import the errors
package.
- Used the generic Error types in place of the single use custom Error
types that have no fields.
- Created new Error types where necessary.
PR: #50
The from-file flag was used to read text from a file for creating
statuses. This flag is now removed and replaced with the file@ prefix
with the content flag.
For example, --from-file status.md is now replaced with
--content file@status.md
Summary:
This commit updates and enhances poll interaction. From now on users
will interact with a poll via the status that contains it. Direct
interaction with the poll (via the poll's ID) is no longer supported.
This helps resolve an issue where it wasn't possible to find the owner
of the poll when interacting with it directly.
Changes:
- Users can no longer view a poll directly using the Poll ID.
Instead polls can be viewed when viewing statuses or timelines.
- More details about a poll is shown in statuses and timelines.
- Votes are now added to polls via statuses.
- Poll results are hidden unless the following conditions are met.
- The user is the owner of the poll.
- The poll has expired.
- The user has already voted in the poll.
- Enbas can now detect and stop a poll owner from voting in their own
poll.
- When a status is created Enbas will now only print the ID of the
created status instead of the whole thing.
PR: apollo/enbas#43Resolvesapollo/enbas#39
CHANGES:
- When viewing followers and followings from an account, the from flag
must now be set by the user.
- enbas show --type followers --from account --my-account
- enbas show --type following --from account --account-name john
- New error type for unsupported show operations: Return an error if
enbas detects an unsupported show operation (e.g. showing media from a
list).
SUMMARY
This commit adds configuration support to enbas. The configuration is
stored as a JSON file in the user specified configuration directory.
When using enbas for the first time, the user will first need to
execute the new init command in order to generate the configuration.
Once this has been generated the user can edit the settings to
personalise their experience, login to their account and use enbas as
normal.
For now the configurable settings included in the configuration
are as follows:
- The path to the credentials file (by default this is set to a file in
the same directory as the configuration file).
- The path to the cache directory.
- The character limit used for line wrapping.
- The programs used for integrations such as paging, media viewing,
opening URLs, etc.
CHANGES
- added the new config type.
- added the new init executor for generating a new configuration file.
- removed the following top level flags in favour of the new
configration support.
- cache-dir
- pager
- image-viewer
- video-player
- max-terminal-width
- added a new error type for use when an unknown media attachment ID
is specified.
- updated the usage function for the executors to support a case
where a flagsets has no flags.
- update .golangci.yaml to disable some linters
Changes:
- moved the command names from main to the executor package.
- moved the unknownCommandError to the executor package and renamed it
to UnknownCommandError.
- define the command summaries within the executor package.
- replace the switch statement in main.run() with a hashmap for looking
up the corresponding executor to the given command.
- transformed BlockExecutor to BlockOrUnblockExecutor.
- transformed FollowExecutor to FollowOrUnfollowExecutor.
Additional fixes:
- fixed flag for the version executor.
Changes:
- Move InvalidListRepliesPolicyError, InvalidTimelineCategory,
InvalidStatusVisibility and InvalidStatusContentTypeError type to the
model package.
- Clean up some code in regards to the parsing of the Enum types.
- Clean up the error messages sent back to the user.
- Use colons instead of semicolons when unwrapping error messages.
- Print errors to Standard Error (os.Stderr)
Allow users to post a status from a file using the --from-file flag.
If both --content and --from-file flags are used then the --content
flag takes precedence.
Move all executors to the internal folder package. This PR also comes
with additional breaking changes.
Changes:
- refactor: move all executors to the internal/executor package.
- refactor: update naming patterns for constants, variables, custom
types, etc.
- fix(breaking): renamed the update command to edit.
- fix(breaking): update the flags for the switch command to make it
more generic.
- fix(breaking): renamed the show-account-relationship flag to
show-relationship.
- fix: update the print message from the whoami command.