this uses the usersLoggedIn helper to check for already logged in users,
selecting the single user when only one present and returning and error
when multiple are logged in.
this changes all api calls to respect the flags for tor and tor-port
- config now has TorPort method to return flag value if set, or default
- api now only has newClient, this creates a tor client when flag is
present. does not need to be exported anymore
- no methods take a tor argument as no longer needed
- all commands now share the same behaviour logging tor messages
- api.torClient was removed as not used anywhere
- all calls to api.newClient now check for and return the error
- api.HandlePost was removed as redundant of api.DoPost
- now allows authentication with more than one user per host, stored as
username.json inside the [host] directory.
- supports a default user and host in config.ini
- global flags will override the default
- adds new user/u flag to wf
- load and save user file based on username
- removed host flag from writeas
- adds hidden global flag for user to writeas to maintain
compatibility
- Presents a summary before making the request when verbose (-v) enabled
- Successful claims only shown with verbose (-v) enabled
- Failed claims now always mention cause of failure
- A summary of successes / failures shows after logging any failures,
when verbose (-v) enabled
Ref T194
This changes the 'posts' subcommand, previously 'list', to also list any
remote posts for the user if currently authenticated.
- adds DoFetchPosts to the api pkg which returns all the logged in users
posts.
- adds a RemotePost type to the api pkg which stores some of the return
information from DoFetchPosts for use in printing to stdout
- adds GetUserPosts to the api pkg which converts the incoming
writeas.Posts into the smaller RemotePost type
- adds getExcerpt which takes the incoming writeas.Post.Content and
returns a trimmed down excerpt of the content. Max 2 lines of 80 chars
and delimited by '...'
- changes CmdList from pkg commands to CmdListPosts which now writes out
any local and remote posts in simple formatted tables
this adds a configurable directory, currently within the users path for
the configuration, user and post data to be saved.
it is accessible down the stack of the application via the cli.Context,
specificaly c.App.ExtraData which is a function that returns a map of
[string]string under the key 'configDir".
this splits everything out into shared packages
- user config and application config share a package for now
- sync is part of the api package which includes the client, posts and
tor logic
- logging is it's own package
- commands are in their own package