Closed thaJeztah closed 1 year ago
Patch coverage: 24.24
% and project coverage change: -0.56
:warning:
Comparison is base (
f8e94d9
) 55.23% compared to head (129017a
) 54.68%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
See individual commits for details. Some outlined below:
client: use os/exec/Cmd.Environ() instead of os.Environ()
Don't set Env if not set; the default is already handled if it's nil; from the documentation: https://pkg.go.dev/os/exec@go1.20.4#Cmd.Env
Use
os/exec/Cmd.Environ()
instead ofos.Environ()
, which was added in go1.19, and handles additional environment variables, such asPWD
on POSIX systems, andSYSTEMROOT
on Windows. https://pkg.go.dev/os/exec@go1.20.4#Cmd.EnvironAlso remove a redundant
fmt.Sprintf()
, as we're only concatenating strings.credentials: Serve(): use "Name instead of "os.Args[0]" for usage output
GNU guidelines describes; https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html#g_t_002d_002dversion
Although the above recommendation is for
--version
output, it probably makes sense to do the same for the "usage" output.Before this change:
With this patch:
credentials: Serve(): simplify error-handling logic
Don't use an err if we can print the error immediately :)
credentials: HandleCommand(): improve error for unknown command/action
Before this change:
After this change:
credentials: Serve(): implement "--version, -v", and "--help, -h" flags
As recommended in the GNU documentation;
With this patch:
credentials: define consts for supported actions (sub-commands)