Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed hauler completion commands #312

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

zackbradys
Copy link
Member

@zackbradys zackbradys commented Aug 27, 2024

Please check below, if the PR fulfills these requirements:

  • Commit(s) and code follow the repositories guidelines.
  • Test(s) have been added or updated to support these change(s).
  • Doc(s) have been added or updated to support these change(s).

Associated Links:

Types of Changes:

  • Bugfix on v1.1.0-rc.1

Proposed Changes:

  • Removed the additional top-level command and added Root() to each completion generation function
  • After testing and validating the initial release candidate of v1.1.0-rc.1, I noticed that the recent PR of Updated cobra function for shell completion #304 did fix the issues with the outputted autocompletion scripts, but introduce a bug by creating an additional top-level command of hauler hauler <shell>, instead of properly nesting completion under hauler with the fixed outputted autocompletion scripts.
  • Hopefully the new Tests Workflow will let me/us catch this better...
zackbradys@Zacks-MBP Downloads % curl -sfL https://get.hauler.dev | sudo HAULER_VERSION=1.1.0-rc.1 bash
Password:

[INFO] Hauler: Starting Preflight Checks...

[INFO] Hauler: Starting Installation...
- Version: v1.1.0-rc.1
- Platform: darwin
- Architecture: arm64
- Install Directory: /Users/zackbradys/Downloads/

[INFO] Hauler: Starting Download...

[INFO] Hauler: Starting Checksum Verification...
- Expected Checksum: 5c6586b8bf52773cf3e76c737e10d777c948028965bcc80695612ffeadbba22e
- Determined Checksum: 5c6586b8bf52773cf3e76c737e10d777c948028965bcc80695612ffeadbba22e
- Successfully Verified Checksum: hauler_1.1.0-rc.1_darwin_arm64.tar.gz

[INFO] Hauler: Successfully Installed Hauler at /usr/local/bin/hauler

[INFO] Hauler: Hauler v1.1.0-rc.1 is now available for use!
- Documentation: https://hauler.dev

zackbradys@Zacks-MBP Downloads % hauler --help
Airgap Swiss Army Knife

Usage:
  hauler [flags]
  hauler [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  hauler      Generates completion scripts for various shells
  help        Help about any command
  login       Log in to a registry
  store       Interact with hauler's embedded content store
  version     Print the current version

Flags:
  -h, --help               help for hauler
  -l, --log-level string    (default "info")

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

zackbradys@Zacks-MBP Downloads % hauler hauler --help
The completion sub-command generates completion scripts for various shells.

Usage:
  hauler hauler [command]

Available Commands:
  bash        Generates bash completion scripts
  fish        Generates fish completion scripts
  powershell  Generates powershell completion scripts
  zsh         Generates zsh completion scripts

Flags:
  -h, --help   help for hauler

Global Flags:
  -l, --log-level string    (default "info")

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

Verification/Testing of Changes:

  • View the PR Tests Workflow
  • Clone the PR and run make build:
zackbradys@Zacks-MBP Downloads % ./dist/hauler_darwin_arm64/hauler --help
Airgap Swiss Army Knife

Usage:
  hauler [flags]
  hauler [command]

Available Commands:
  completion  Generate autocompletion scripts for various shells
  help        Help about any command
  login       Login to a registry
  store       Interact with the embedded content store
  version     Print the current version

Flags:
  -h, --help               help for hauler
  -l, --log-level string    (default "info")

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

zackbradys@Zacks-MBP Downloads % ./dist/hauler_darwin_arm64/hauler completion --help
Generate autocompletion scripts for various shells

Usage:
  hauler completion [command]

Available Commands:
  bash        Generates completion scripts for bash
  fish        Generates completion scripts for fish
  powershell  Generates completion scripts for powershell
  zsh         Generates completion scripts for zsh

Flags:
  -h, --help   help for completion

Global Flags:
  -l, --log-level string    (default "info")

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

Additional Context:

  • N/A

@zackbradys zackbradys self-assigned this Aug 27, 2024
@zackbradys zackbradys requested a review from a team August 27, 2024 06:38
@zackbradys zackbradys added bug Something isn't working size/S Denotes an issue/PR requiring a relatively small amount of work labels Aug 27, 2024
@zackbradys zackbradys added this to the Hauler v1.1.0 milestone Aug 27, 2024
@zackbradys zackbradys merged commit 02231d7 into hauler-dev:main Aug 29, 2024
2 checks passed
@zackbradys zackbradys deleted the fixed-completion-again branch August 29, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/S Denotes an issue/PR requiring a relatively small amount of work
Projects
Status: Resolved
Development

Successfully merging this pull request may close these issues.

2 participants