marcosnils/bin

Print usage when no command is supplied.

Closed this issue · 2 comments

Bin should print its usage info when executed without any command.

Expected behavior:

$ bin
Effortless binary manager

Usage:
  bin [command]

Available Commands:
  help        Help about any command
  install     Installs the specified project
  list        List binaries managed by bin
  prune       Prunes binaries that no longer exist in the system
  remove      Removes binaries managed by bin
  update      Updates one or multiple binaries managed by bin

Flags:
      --debug     Enable debug mode
  -h, --help      help for bin
  -v, --version   version for bin

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

Observed Behavior:

$ bin 

 Path   Version         URL     Status

OS/Arch: Linux/x86
Bin version:

bin version 0.2.0
commit: 1e4d59085ecfa8dd0558d237407382eda76c5d3c
built at: 2020-08-09T15:41:51Z
built by: goreleaser

Thx for the contribution. This decision was intentional, since I prefer it this way. #35 (comment)

Okay, but why then does bin help and bin --help behave differently?

$ bin --help
Effortless binary manager

Usage:
  bin [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  ensure      Ensures that all binaries listed in the configuration are present
  help        Help about any command
  install     Installs the specified project from a url
  list        List binaries managed by bin
  prune       Prunes binaries that no longer exist in the system
  remove      Removes binaries managed by bin
  update      Updates one or multiple binaries managed by bin

Flags:
      --debug     Enable debug mode
  -h, --help      help for bin
  -v, --version   version for bin

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

$ bin help  

 Path				Version		URL					Status
 /home/jcube/.local/bin/pants	v0.5.4		github.com/pantsbuild/scie-pants	OK

$ bin help install

 Path				Version		URL					Status
 /home/jcube/.local/bin/pants	v0.5.4		github.com/pantsbuild/scie-pants	OK

$ bin install --help                                       
Installs the specified project from a url

Usage:
  bin install <url> [flags]

Aliases:
  install, i

Flags:
  -a, --all               Show all possible download options (skip scoring & filtering)
  -f, --force             Force the installation even if the file already exists
  -h, --help              help for install
  -p, --provider string   Forces to use a specific provider

Global Flags:
      --debug   Enable debug mode

help command (not option --help) feels useless.

$ bin --version
bin version 0.16.2
commit: d1213c11e63483174ed95308c9eb6372bb9b16e9
built at: 2023-02-21T13:11:19Z
built by: goreleaser\

Okay, but why then does bin help and bin --help behave differently?

it's a bug, just pushed a fix for that 2d0b198