Skip to content

Commit

Permalink
Prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
bakks committed Oct 27, 2022
1 parent e0b6562 commit e85f480
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 168 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ builds:
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}}
- -s -w -X main.BuildVersion={{.Tag}} -X main.BuildArch={{.Arch}} -X main.BuildCommit={{.ShortCommit}} -X main.BuildTimestamp={{.Date}} -X main.BuildOs={{.Os}}

- id: darwin-arm64
main: ./
Expand All @@ -29,7 +29,7 @@ builds:
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}}
- -s -w -X main.BuildVersion={{.Tag}} -X main.BuildArch={{.Arch}} -X main.BuildCommit={{.ShortCommit}} -X main.BuildTimestamp={{.Date}} -X main.BuildOs={{.Os}}


release:
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ A modern top command that charts system metrics like CPU load, network IO, etc i
" target="_blank"><img src="https://github.com/bakks/poptop/raw/main/assets/screenshot.png"
alt="Video of Poptop" /></a>

## Installation

Poptop has only been built and tested on MacOS (amd64 and arm64). Install using Homebrew:

```
brew tap bakks/bakks
brew install poptop
```

## Operation

After installation with homebrew, execute with `poptop` on the command line.

```
Flags:
-h, --help Show help information
Expand Down
5 changes: 0 additions & 5 deletions dist/CHANGELOG.md

This file was deleted.

156 changes: 0 additions & 156 deletions dist/config.yaml

This file was deleted.

21 changes: 16 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ import (
"github.com/mum4k/termdash/terminal/terminalapi"
)

const License = "MIT License - Copyright (c) 2022 Peter Bakkum"

var ( // these are filled in at build time
BuildVersion string
BuildArch string
BuildCommit string
BuildOs string
BuildTimestamp string
)

func getBuildInfo() string {
return fmt.Sprintf("Poptop %s %s %s (commit %s) (built %s)\n%s\n", BuildVersion, BuildOs, BuildArch, BuildCommit, BuildTimestamp, License)
}

func min(a, b int) int {
if a < b {
return a
Expand Down Expand Up @@ -318,9 +332,7 @@ You can also use the -w flag to arrange charts in a square, i.e. to switch betwe
## Top Memory Processes (%, pid, command)
Show a list of top Memory processes output by the ps command, i.e. which processes are consuming the most real memory. This is sampled at one-fourth of the sample interval rate since this is a point-in-time list rather than a chart. Run 'man ps' for more information on calculation methodology.
MIT License - Copyright (c) 2022 Peter Bakkum`
Show a list of top Memory processes output by the ps command, i.e. which processes are consuming the most real memory. This is sampled at one-fourth of the sample interval rate since this is a point-in-time list rather than a chart. Run 'man ps' for more information on calculation methodology.`

func (this *PoptopConfig) selectWidget(widget int) {
if !this.SelectWidgetsMode {
Expand Down Expand Up @@ -417,8 +429,7 @@ func main() {

if cli.Help {
kong.DefaultHelpPrinter(kong.HelpOptions{}, kongCtx)
fmt.Printf("\n\n")
fmt.Println(helpContent)
fmt.Printf("\n\n%s\n\n%s", helpContent, getBuildInfo())
os.Exit(0)
}

Expand Down

0 comments on commit e85f480

Please sign in to comment.