Rename proboctl CLI binary to prb
Shorter CLI name for faster typing. Renames the binary, build targets, goreleaser config, command examples, and documentation. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -104,7 +104,7 @@ func (c *Client) DoRaw(
|
||||
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
req.Header.Set("Authorization", "Bearer "+c.token)
|
||||
req.Header.Set("User-Agent", version.UserAgent("proboctl"))
|
||||
req.Header.Set("User-Agent", version.UserAgent("prb"))
|
||||
|
||||
resp, err := c.httpClient.Do(req)
|
||||
if err != nil {
|
||||
@@ -120,7 +120,7 @@ func (c *Client) DoRaw(
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
switch resp.StatusCode {
|
||||
case http.StatusUnauthorized:
|
||||
return nil, fmt.Errorf("authentication failed (HTTP 401): token may be invalid or expired, try 'proboctl auth login'")
|
||||
return nil, fmt.Errorf("authentication failed (HTTP 401): token may be invalid or expired, try 'prb auth login'")
|
||||
case http.StatusForbidden:
|
||||
return nil, fmt.Errorf("access denied (HTTP 403): you do not have permission to perform this action")
|
||||
default:
|
||||
|
||||
@@ -113,7 +113,7 @@ func configDir() (string, error) {
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("cannot determine config directory: %w", err)
|
||||
}
|
||||
return filepath.Join(dir, "proboctl"), nil
|
||||
return filepath.Join(dir, "prb"), nil
|
||||
}
|
||||
|
||||
func configPath() (string, error) {
|
||||
@@ -188,7 +188,7 @@ func (c *Config) DefaultHost() (string, *HostConfig, error) {
|
||||
|
||||
if token := os.Getenv("PROBO_TOKEN"); token != "" {
|
||||
if len(hosts) == 0 {
|
||||
return "", nil, fmt.Errorf("PROBO_TOKEN is set but no host configured; run 'proboctl auth login' first")
|
||||
return "", nil, fmt.Errorf("PROBO_TOKEN is set but no host configured; run 'prb auth login' first")
|
||||
}
|
||||
|
||||
host := hosts[0]
|
||||
@@ -215,5 +215,5 @@ func (c *Config) DefaultHost() (string, *HostConfig, error) {
|
||||
return host, c.Hosts[host], nil
|
||||
}
|
||||
|
||||
return "", nil, fmt.Errorf("not logged in; run 'proboctl auth login' first")
|
||||
return "", nil, fmt.Errorf("not logged in; run 'prb auth login' first")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user