bwplotka / bingo

Like `go get` but for Go tools! CI Automating versioning of Go binaries in a nested, isolated Go modules.
Apache License 2.0
342 stars 29 forks source link

Command line refactoring provides friendly prompts #126

Closed aimuz closed 7 months ago

aimuz commented 1 year ago

In the process of using it, I found the current prompt messages too confusing

When I execute bingo, I am prompted with the following message

bingo: 'go get' like, simple CLI that allows automated versioning of Go package level binaries (e.g required as dev tools by your project!)
built on top of Go Modules, allowing reproducible dev environments. 'bingo' allows to easily maintain a separate, nested Go Module for each binary.

For detailed examples and documentation see: https://github.com/bwplotka/bingo

'bingo' supports following commands:

Commands:

  get <flags> [<package or binary>[@version1,none,latest,version2,version3...]]

  -go string
        Path to the go command. (default "go")
  -insecure
        Use -insecure flag when using 'go get'
  -l    If enabled, bingo will also create soft link called <tool> that links to the current<tool>-<version> binary. Use Variables.mk and variables.env if you want to be sure that what you are invoking is what is pinned.
  -moddir string
        Directory where separate modules for each binary will be maintained. Feel free to commit this directory to your VCS to bond binary versions to your project code. If the directory does not exist bingo logs and assumes a fresh project. (default ".bingo")
  -n string
        The -n flag instructs to get binary and name it with given name instead of default, so the last element of package directory. Allowed characters [A-z0-9._-]. If -n is used and no package/binary is specified, bingo get will return error. If -n is used with existing binary name, copy of this binary will be done. Cannot be used with -r
  -r string
        The -r flag instructs to get existing binary and rename it with given name. Allowed characters [A-z0-9._-]. If -r is used and no package/binary is specified or non existing binary name is used, bingo will return error. Cannot be used with -n.
  -v    Print more'

  list <flags> [<package or binary>]

List enumerates all or one binary that are/is currently pinned in this project. It will print exact path, Version and immutable output.

  -moddir string
        Directory where separate modules for each binary is maintained. If does not exists, bingo list will fail. (default ".bingo")
  -v    Print more'

  version

Prints bingo Version.

In contrast, gh looks like this

Work seamlessly with GitHub from the command line.

USAGE
  gh <command> <subcommand> [flags]

CORE COMMANDS
  auth:        Authenticate gh and git with GitHub
  browse:      Open the repository in the browser
  codespace:   Connect to and manage codespaces
  gist:        Manage gists
  issue:       Manage issues
  pr:          Manage pull requests
  release:     Manage releases
  repo:        Manage repositories

ACTIONS COMMANDS
  run:         View details about workflow runs
  workflow:    View details about GitHub Actions workflows

ADDITIONAL COMMANDS
  alias:       Create command shortcuts
  api:         Make an authenticated GitHub API request
  completion:  Generate shell completion scripts
  config:      Manage configuration for gh
  extension:   Manage gh extensions
  gpg-key:     Manage GPG keys
  help:        Help about any command
  label:       Manage labels
  search:      Search for repositories, issues, and pull requests
  secret:      Manage GitHub secrets
  ssh-key:     Manage SSH keys
  status:      Print information about relevant issues, pull requests, and notifications across repositories

HELP TOPICS
  actions:     Learn about working with GitHub Actions
  environment: Environment variables that can be used with gh
  exit-codes:  Exit codes used by gh
  formatting:  Formatting options for JSON data exported from gh
  mintty:      Information about using gh with MinTTY
  reference:   A comprehensive reference of all gh commands

FLAGS
  --help      Show help for command
  --version   Show gh version

EXAMPLES
  $ gh issue create
  $ gh repo clone cli/cli
  $ gh pr checkout 321

LEARN MORE
  Use 'gh <command> <subcommand> --help' for more information about a command.
  Read the manual at https://cli.github.com/manual

FEEDBACK
  Open an issue using 'gh issue create -R github.com/cli/cli'

He outputs help with hierarchy, can bingo be changed to do the same? Provide enough examples in the help

Here's a simple change I made

Bingo is a command line tool for Like `go get`  but for Go tools!
CI Automating versioning of Go binaries in a nested, isolated Go modules.
For detailed examples and documentation see: https://github.com/bwplotka/bingo

Usage:
  bingo [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  get
  help        Help about any command
  list        List enumerates all or one binary that are/is currently pinned in this project.
  version     Prints bingo Version.

Flags:
  -h, --help            help for bingo
  -m, --moddir string   Directory where separate modules for each binary will be maintained.
                        Feel free to commit this directory to your VCS to bond binary versions to your project code.
                        If the directory does not exist bingo logs and assumes a fresh project. (default ".bingo")
  -v, --verbose         Print more

Use "bingo [command] --help" for more information about a command.

In terms of output they are more concise and the use has not changed

bwplotka commented 1 year ago

Love it. We would welcome such contribution! Thanks!

aimuz commented 1 year ago

https://github.com/bwplotka/bingo/pull/121

Can this PR be reopened?

bwplotka commented 1 year ago

Ah it requires cobra framework, sorry closing your PR so quickly - with this issue (or perhaps description mentioning the motivation) I see the reason now. Thanks!

I think I would be keen to have it, but we would need to change if all flag behave as it should - CI should check that. Let me reopen.

aimuz commented 7 months ago

fixed #121