Parse the flags before loading the configuration to fix the error where
using the --help flag caused the app to return an error if the
configuration file does not exist.
- Move the build and application information to the internal info
package.
- Move the user agent and redirect URI string to the internal client
package.
Updated the executor lookup table by changing the map type from
map[string]Executor to map[string]func(string, bool, []string) error in
order to reduce the cost of initialising the map.
Previously the map initialised all the executors despite only needing
to run the single executor called by the command. The map now instead
maps the command to the function of type
'func(string, bool, []string) error' that will initialise and run the
executor called by the command. As a result of the change, the
Executor interface is no longer needed and has been removed.
PR: #57
This commit adds a new parser for the internal time duration flag value
(TimeDurationValue). Previously this used the parser from the time
package from the standard library but this was limited to parsing units
of time up to hours.
The new parser allows users to specify duration in days, hours, minutes,
seconds and a combination of the above. It is quite flexible in the way
users format their string input.
Additonal changes:
- Added unit tests for the command-line parsing of the
TimeDurationValue type.
- Updated the unit tests for the BoolPtrValue type.
- Updated documentation.
PR: #55
- Fixed the BoolPtrValue type in the internal flag package by adding the
IsBoolFlag() bool method to indicate to the command-line parser that
the flag is a boolean flag.
- Added unit tests for the BoolPtrValue type.
PR: #56
Summary:
If the user hasn't supplied the path to a configuration directory and
Enbas fails to find the user's default home configuration directory,
Enbas will now return an error message back to the user. Previously
Enbas would try to, instead, calculate the configuration directory
using the user's current directory.
Changes:
- Return an error if the user's home configuration directory cannot
be found.
- Add tests to the internal.config package.
- Update the tests in internal.utilities package.
PR: #54
Rename the spoiler-text flag to summary as the text represents the
status' summary. The usage message and manual indicates that the text is
also known as the spoiler text or content warning.
Changes:
- Fixed the issue where the instance's FQDN was not included in the
cache directories' path when the user sets a custom path to the root
cache directory.
- Added unit tests for the cache directory calculations.
- Updated REUSE.toml to fix compliance failures.
- Added small changes/fixes based on feedback from golangci-lint.
PR: #53
Resolves: #51
- 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
This commit adds support for deleting statuses.
Before sending the delete request to the instance, Enbas will first
verify that the status that the user wants to delete actually belongs to
them.
The user has the option to save the text of the deleted status. This
will be written to a text file within the cache directory.
PR: #48
Resolves: #44
This commit adds support for muting and unmuting statuses. When viewing
a status the user can now see whether they've muted the status or not.
A status can only be muted by the user if they own it or are mentioned
in it.
PR: apollo/enbas#47Resolves: apollo/enbas#46
This commit adds more support for interacting with media attachments.
Now users can:
- Upload media to their instances and create media attachments.
- Edit existing media attachments.
- Attach one or more existing media to a new status.
- Upload and attach one or more media files to a new status.
PR: apollo/enbas#42Resolves: apollo/enbas#29
Updated the ReadFile function in 'utilities' by using the Scanner from
the bufio package to read lines from a text file. The trailing empty
line is stripped after scanning and before returning back to the caller.
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
Summary:
- Created a custom CLI schema for Enbas which will act as the Source
of Truth for code and document generation.
- Created a code generator which uses the schema to generate the
executor definitions and code in the internal usage package.
Changes:
- Created the Enbas CLI schema as the Source of Truth for Enbas.
- Created the code generator that generates the executor
definitions and code in the usage package.
- Regenerated the executor definitions using the code generator.
- Moved the custom flag value types to the new internal flag
package.
- Created a new flag value type for the bool pointer to replace the
flag.BoolFunc() used for the sensitive and no-color flags.
- Moved the version and build variables to the new internal version
package to simplify the version executor.
- Created a new usage package and moved the usage functions there.
- Changed the type of the account-name flag from string to the
internal StringSliceValue type.
- Show whether a status is a boost, a reply to another status or a
normal post.
- Move the "Created At" field to a new line.
- Show the date and time when a status was boosted.
Improve how ordered and unordered lists are displayed within the
contents of a status by adding indentation when a list item is wrapped.
Changes:
- fix: improve how ordered and unordered lists are displayed in status
and status list views.
- fix: improve how media attachments are displayed in status list views.
- refactor: move the line wrapping and HTML converting functions from
utilities to the internal printer package.
- refactor: the convertHTMLToText now (optionally) applies line
wrapping after conversion.
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).
- Converted documentation from Asciidoc to Markdown
- Updated the installation instructions and moved to a separate
file in the docs directory.
- Updated the login instructions and moved to the Getting Started guide
in the docs directory.
- Updated the licensing information in the main README.
- Created a page for changelog.
- Create a page for the user manual.
When creating the configuration file during the initialisation process
calculate the absolute path to the credentials file instead of the
relative path.
Use the browser specified in the configuration file to open URLs. If the
browser is not specified the link will not be opened and an error is
returned to the user in most cases. This replaces the use of the BROWSER
environment variable and the xdg-open command (on linux).
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