writeas / writeas-cli

Command line client for Write.as / WriteFreely
https://write.as/apps/cli
GNU General Public License v3.0
113 stars 20 forks source link

return errors on delete command #30

Closed ghost closed 5 years ago

ghost commented 5 years ago

changes command for delete to return errors to the user

also updates comment for DoDelete

this is part of writeas/writefreely#117

thebaer commented 5 years ago

Thanks, good catch.

I know we're kind of inconsistent with what we use right now. But do you think it'd be better to use return cli.NewExitError(...), as we do earlier in that func, instead? I'm kind of leaning that way.

ghost commented 5 years ago

That's probably the best way, should we change all occurrences in CmdDelete? and later update other commands as they are touched?

thebaer commented 5 years ago

I would just change it for the two instances in this PR, and then yeah, we'll update other places as they're touched.

(I say only these two places, because especially with multiple-line logs, there might've been a reason I went with the log.ErrorlnQuit -- I'm not sure off the top of my head.)

ghost commented 5 years ago

:+1:

thebaer commented 5 years ago

Perfect. Looks good to me!