Slack Status Updater (CLI) - Alpha polish
Little acts of polish on the road to a stable Beta
March 27th 2018
12:45 Early this morning I moved the functionality dealing with setting the status via the CLI into its own function and made it so that there are two ways to set a status.
slackstatus <statusname> OR slackstatus set <statusname>. I can't decide yet which one I like more so I'm keeping both for the time. I'm going to release it now :).
15:46 Paused to get some work done. When I returned I wanted to hack on getting the listing functionality done. It's simple enough. I have all the methods I need to retrieve the data. I just need to iterate and print through it. The only problem was that pretty printing is actually a lot harder than it looks. I had to spend nearly 45 minutes figuring out how the text/tabwriter package works.
- Basically I create a
tabwriter.Writerinstance, grant it properties like padding and tab size and delimiter character. - I then use
fmt.Fprintlnwhich does everything it should do normally and send the output to thetabwriter.Writerinstance. - When I'm done, I use
Writer.Flush()to actually send the output to the terminal or wherever it is (I can specify what output mechanism I want when initialising theWriter).
It looks good, so I'm going to mark it as v0.1.0 and send it out into the world!
March 28th 2018
13:14 After using the CLI for a while I think what I'd really like to do now is to be able to unset the status entirely and set the my availability to online and away. But before I do that, I'm going to get this CLI ready to be shared with people. Opening up a separate post for that
Posted on March 27 2018 by Adnan Issadeen