Skip to content

Commit

Permalink
hide unreleased features in prod build
Browse files Browse the repository at this point in the history
  • Loading branch information
aybabtme committed Oct 23, 2024
1 parent 34de708 commit da9ff5a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease={{.Prerelease}} -X main.versionBuild={{.ShortCommit}}
- -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease={{.Prerelease}} -X main.versionBuild={{.ShortCommit}} -X main.hideUnreleasedFeatures=true
goos:
# - windows
- darwin
Expand Down
5 changes: 3 additions & 2 deletions cmd/humanlog/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ func accountCmd(
getHTTPClient func(*cli.Context) *http.Client,
) cli.Command {
return cli.Command{
Name: accountCmdName,
Usage: "Manage accounts for the current user or org.",
Hidden: hideUnreleasedFeatures == "true",
Name: accountCmdName,
Usage: "Manage accounts for the current user or org.",
Before: func(cctx *cli.Context) error {
ctx := getCtx(cctx)
state := getState(cctx)
Expand Down
2 changes: 1 addition & 1 deletion cmd/humanlog/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func authCmd(
) cli.Command {
return cli.Command{
Name: authCmdName,
Usage: "Authenticate with humanlog.io",
Usage: "Login with humanlog.io",
Subcommands: cli.Commands{
{
Name: "login",
Expand Down
5 changes: 3 additions & 2 deletions cmd/humanlog/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ func machineCmd(
getHTTPClient func(*cli.Context) *http.Client,
) cli.Command {
return cli.Command{
Name: machineCmdName,
Usage: "Manage machines in the current account.",
Hidden: hideUnreleasedFeatures == "true",
Name: machineCmdName,
Usage: "Manage machines in the current account.",
Before: func(cctx *cli.Context) error {
ctx := getCtx(cctx)
state := getState(cctx)
Expand Down
13 changes: 9 additions & 4 deletions cmd/humanlog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ var (
}
return v
}()
defaultApiAddr = "https://api.humanlog.io"
defaultBaseSiteAddr = "https://humanlog.io"
defaultApiAddr = "https://api.humanlog.io"
defaultBaseSiteAddr = "https://humanlog.io"
hideUnreleasedFeatures = ""

huhTheme = huh.ThemeCatppuccin()
)
Expand Down Expand Up @@ -194,21 +195,25 @@ func newApp() *cli.App {

app := cli.NewApp()
app.Author = "humanlog.io"
app.Email = "[email protected]"
app.Email = "[email protected]"
app.Name = "humanlog"
app.Version = semverVersion.String()
app.Usage = "reads structured logs from stdin, makes them pretty on stdout!"
app.Description = `humanlog parses logs and makes them easier to read and search.
When invoked with no argument, it consumes stdin and parses it,
attempts to make it prettier on stdout. It also allows searching
attempting to make detected logs prettier on stdout.`
if hideUnreleasedFeatures != "true" {
app.Description += `
It also allows searching
the logs that were parsed, both in a TUI by pressing "s" or in a
webapp by pressing "space".
If registered to ingest logs via "humanlog machine register" logs
will be saved to humanlog.io for vizualization, searching and
analysis.
`
}

var (
ctx context.Context
Expand Down
1 change: 1 addition & 0 deletions cmd/humanlog/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func organizationCmd(
)

return cli.Command{
Hidden: hideUnreleasedFeatures == "true",
Name: organizationCmdName,
ShortName: "org",
Usage: "Manage organizations for the current user.",
Expand Down
5 changes: 3 additions & 2 deletions cmd/humanlog/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ func queryCmd(
getHTTPClient func(*cli.Context) *http.Client,
) cli.Command {
return cli.Command{
Name: queryCmdName,
Usage: "Query your logs",
Hidden: hideUnreleasedFeatures == "true",
Name: queryCmdName,
Usage: "Query your logs",

Subcommands: []cli.Command{
{
Expand Down

0 comments on commit da9ff5a

Please sign in to comment.