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

Add all flag to 'gh alias delete' #7900

Merged
merged 7 commits into from Sep 7, 2023

Conversation

JunNishimura
Copy link
Contributor

@JunNishimura JunNishimura commented Aug 26, 2023

Overview

I added all flag to alias delete command to delete all registered aliases.

Discussion

I'm wondering how the GitHub cli should behave when the alias name to delete and all flag are specified at the same time as in the following example. (I know this kind of case rarely happens)

$ gh alias delete hoge --all

The current behaviour is that the all flag has priority and all registered flags are deleted.

Related Issue

@JunNishimura JunNishimura marked this pull request as ready for review August 26, 2023 09:46
@JunNishimura JunNishimura requested a review from a team as a code owner August 26, 2023 09:46
@JunNishimura JunNishimura requested review from williammartin and removed request for a team August 26, 2023 09:46
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Aug 26, 2023
@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI Aug 26, 2023
@samcoe
Copy link
Contributor

samcoe commented Aug 28, 2023

@JunNishimura I think if both the --all flag is specified as well as an argument the command should error out with a message saying that it is an invalid combination of arguments and flags, similar to the extension upgrade command.

@samcoe samcoe self-assigned this Aug 28, 2023
@samcoe samcoe self-requested a review August 28, 2023 20:18
@samcoe samcoe mentioned this pull request Aug 28, 2023
@JunNishimura
Copy link
Contributor Author

@samcoe
Thanks for your help.
I added argument validations and unit testing (and a little bit refactoring).

I would appreciate it if you check the PR again!

Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JunNishimura Thanks for the contribution! I pushed a commit to make the command a bit more testable and also to update the tests to be more inline with our current testing patterns. This is ready to 🚢.

@samcoe samcoe enabled auto-merge (squash) September 7, 2023 10:45
@samcoe samcoe merged commit 925473e into cli:trunk Sep 7, 2023
6 checks passed
@JunNishimura JunNishimura deleted the add-all-flag-to-alias-delete branch September 7, 2023 12:58
renovate bot added a commit to scottames/dots that referenced this pull request Sep 22, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [aquaproj/aqua-registry](https://togithub.com/aquaproj/aqua-registry)
| minor | `v4.48.2` -> `v4.52.0` |
| [cli/cli](https://togithub.com/cli/cli) | minor | `v2.34.0` ->
`v2.35.0` |
| [fluxcd/flux2](https://togithub.com/fluxcd/flux2) | patch | `v2.1.0`
-> `v2.1.1` |
| [twpayne/chezmoi](https://togithub.com/twpayne/chezmoi) | minor |
`v2.39.1` -> `v2.40.0` |
| [weaveworks/eksctl](https://togithub.com/weaveworks/eksctl) | minor |
`v0.157.0` -> `v0.158.0` |

---

### Release Notes

<details>
<summary>aquaproj/aqua-registry (aquaproj/aqua-registry)</summary>

###
[`v4.52.0`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.52.0)

[Compare
Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.51.0...v4.52.0)


[Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.52.0)
| [Pull
Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.52.0)
| aquaproj/aqua-registry@v4.51.0...v4.52.0

#### 🎉 New Packages


[#&#8203;15604](https://togithub.com/aquaproj/aqua-registry/issues/15604)
[natecraddock/zf](https://togithub.com/natecraddock/zf): a commandline
fuzzy finder designed for filtering filepaths
[@&#8203;4513ECHO](https://togithub.com/4513ECHO)

[#&#8203;15600](https://togithub.com/aquaproj/aqua-registry/issues/15600)
[winebarrel/cronplan/{cronmatch,cronplan,cronviz}](https://togithub.com/winebarrel/cronplan):
Cron expression parser for Amazon EventBridge
[@&#8203;ponkio-o](https://togithub.com/ponkio-o)

#### Fixes


[#&#8203;15605](https://togithub.com/aquaproj/aqua-registry/issues/15605)
cloudflare/cfssl: Rename the package cloudflare/cfssl to
cloudflare/cfssl/cfssl [@&#8203;ponkio-o](https://togithub.com/ponkio-o)

[#&#8203;15602](https://togithub.com/aquaproj/aqua-registry/issues/15602)
protocolbuffers/protobuf/protoc: Support arm64
[@&#8203;4513ECHO](https://togithub.com/4513ECHO)

[#&#8203;15606](https://togithub.com/aquaproj/aqua-registry/issues/15606)
protocolbuffers/protobuf/protoc: Exclude windows/arm64
[@&#8203;4513ECHO](https://togithub.com/4513ECHO)

###
[`v4.51.0`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.51.0)

[Compare
Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.50.0...v4.51.0)


[Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.51.0)
| [Pull
Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.51.0)
| aquaproj/aqua-registry@v4.50.0...v4.51.0

#### 🎉 New Packages


[#&#8203;15578](https://togithub.com/aquaproj/aqua-registry/issues/15578)
[greymd/ojichat](https://togithub.com/greymd/ojichat)
[@&#8203;ryoppippi](https://togithub.com/ryoppippi)

[#&#8203;15583](https://togithub.com/aquaproj/aqua-registry/issues/15583)
[koron/iferr](https://togithub.com/koron/iferr): Generate "if err != nil
{" block [@&#8203;ryoppippi](https://togithub.com/ryoppippi)

[#&#8203;15577](https://togithub.com/aquaproj/aqua-registry/issues/15577)
[mattn/zig-update](https://togithub.com/mattn/zig-update)
[@&#8203;ryoppippi](https://togithub.com/ryoppippi)

[#&#8203;15582](https://togithub.com/aquaproj/aqua-registry/issues/15582)
[mike-engel/jwt-cli](https://togithub.com/mike-engel/jwt-cli): A super
fast CLI tool to decode and encode JWTs built in Rust
[@&#8203;ryoppippi](https://togithub.com/ryoppippi)

[#&#8203;15592](https://togithub.com/aquaproj/aqua-registry/issues/15592)
[simonwhitaker/gibo](https://togithub.com/simonwhitaker/gibo): Easy
access to gitignore boilerplates
[@&#8203;ryoppippi](https://togithub.com/ryoppippi)

[#&#8203;15580](https://togithub.com/aquaproj/aqua-registry/issues/15580)
[tmc/json-to-struct](https://togithub.com/tmc/json-to-struct): A simple
command-line tool for generating to struct definitions from JSON
[@&#8203;ryoppippi](https://togithub.com/ryoppippi)

[#&#8203;15579](https://togithub.com/aquaproj/aqua-registry/issues/15579)
[tomohiro/gyazo-cli](https://togithub.com/tomohiro/gyazo-cli): Gyazo
command-line uploader
[@&#8203;ryoppippi](https://togithub.com/ryoppippi)

###
[`v4.50.0`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.50.0)

[Compare
Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.49.0...v4.50.0)


[Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.50.0)
| [Pull
Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.50.0)
| aquaproj/aqua-registry@v4.49.0...v4.50.0

#### 🎉 New Packages


[#&#8203;15536](https://togithub.com/aquaproj/aqua-registry/issues/15536)
[notaryproject/notation](https://togithub.com/notaryproject/notation): A
CLI tool to sign and verify artifacts

[#&#8203;15543](https://togithub.com/aquaproj/aqua-registry/issues/15543)
[uzimaru0000/oglens](https://togithub.com/uzimaru0000/oglens): Tools for
viewing OGP [@&#8203;ryoppippi](https://togithub.com/ryoppippi)

#### Fixes


[#&#8203;15534](https://togithub.com/aquaproj/aqua-registry/issues/15534)
kdash-rs/kdash: Follow up changes of kdash v0.4.3

[#&#8203;15553](https://togithub.com/aquaproj/aqua-registry/issues/15553)
norwoodj/helm-docs: Follow up changes of helm-docs v1.11.2

Assets were renamed.

-
[norwoodj/helm-docs#181
-
norwoodj/helm-docs@297d05b

###
[`v4.49.0`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.49.0)

[Compare
Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.48.2...v4.49.0)


[Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.49.0)
| [Pull
Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.49.0)
| aquaproj/aqua-registry@v4.48.2...v4.49.0

#### 🎉 New Packages


[#&#8203;15503](https://togithub.com/aquaproj/aqua-registry/issues/15503)
[rustwasm/wasm-pack](https://togithub.com/rustwasm/wasm-pack): your
favorite rust -> wasm workflow tool
[@&#8203;4513ECHO](https://togithub.com/4513ECHO)

#### Fixes


[#&#8203;15501](https://togithub.com/aquaproj/aqua-registry/issues/15501)
noahgorstein/jqp: Follow up changes of jqp v0.5.0

Assets were renamed.

-
[noahgorstein/jqp#43

</details>

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.35.0`](https://togithub.com/cli/cli/releases/tag/v2.35.0):
GitHub CLI 2.35.0

[Compare Source](https://togithub.com/cli/cli/compare/v2.34.0...v2.35.0)

#### What's New

- `gh alias delete` now supports the `--all` flag by
[@&#8203;JunNishimura](https://togithub.com/JunNishimura) in
[cli/cli#7900
- `gh release delete` now supports the `--cleanup-tag` flag by
[@&#8203;kemingy](https://togithub.com/kemingy) in
[cli/cli#7884
- `gh release create` now supports the `--notes-from-tag` flag by
[@&#8203;kbailey4444](https://togithub.com/kbailey4444) in
[cli/cli#7861

#### What's Changed

- Clarified `gh repo list --fork` and `--source` behavior for orgs
[@&#8203;ncalteen](https://togithub.com/ncalteen) in
[cli/cli#7964
- `gh cs create` now shows the full permissions URL by
[@&#8203;joshmgross](https://togithub.com/joshmgross) in
[cli/cli#7983
- Documented when `gh auth login` falls back to using insecure storage
by [@&#8203;kbailey4444](https://togithub.com/kbailey4444) in
[cli/cli#7781
- Bumped goreleaser/goreleaser-action from 4 to 5 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[cli/cli#7981

#### New Contributors

- [@&#8203;kemingy](https://togithub.com/kemingy) made their first
contribution in
[cli/cli#7884
- [@&#8203;ncalteen](https://togithub.com/ncalteen) made their first
contribution in
[cli/cli#7964
- [@&#8203;kbailey4444](https://togithub.com/kbailey4444) made their
first contribution in
[cli/cli#7861

**Full Changelog**: cli/cli@v2.34.0...v2.35.0

</details>

<details>
<summary>fluxcd/flux2 (fluxcd/flux2)</summary>

### [`v2.1.1`](https://togithub.com/fluxcd/flux2/releases/tag/v2.1.1)

[Compare
Source](https://togithub.com/fluxcd/flux2/compare/v2.1.0...v2.1.1)

#### Highlights

Flux `v2.1.1` is a patch release which comes with various fixes. Users
are encouraged to upgrade for the best experience.

##### Fixes

- Use auto lookup strategy for Buckets to widen support for
S3-compatible object storage services (`source-controller`).
- Fix Secret type check for HelmRepositories TLS certs referred in
`.spec.secretRef` (`source-controller`).
- Fix the branch name reporting when the push branch is the same as the
checkout branch (`image-automation-controller`).
-   Restore Helm logs inclusion in failure events (`helm-controller`).
- Fix the impersonation of the default service account when diffing
HelmReleases (`helm-controller`).
- Check source for `nil` artifact before loading Helm charts
(`helm-controller`).
- Update the description of Kubernetes specific flag to distinguish them
from Flux bootstrap flags (`flux` CLI).

#### Components changelog

- source-controller
[v1.1.1](https://togithub.com/fluxcd/source-controller/blob/v1.1.1/CHANGELOG.md)
- helm-controller
[v0.36.1](https://togithub.com/fluxcd/helm-controller/blob/v0.36.1/CHANGELOG.md)
- image-automation-controller
[v0.36.1](https://togithub.com/fluxcd/image-automation-controller/blob/v0.36.1/CHANGELOG.md)

#### CLI Changelog

- PR [#&#8203;4255](https://togithub.com/fluxcd/flux2/issues/4255) -
[@&#8203;hiddeco](https://togithub.com/hiddeco) - tests/azure: update
controller dependencies
- PR [#&#8203;4251](https://togithub.com/fluxcd/flux2/issues/4251) -
[@&#8203;fluxcdbot](https://togithub.com/fluxcdbot) - Update toolkit
components
- PR [#&#8203;4246](https://togithub.com/fluxcd/flux2/issues/4246) -
[@&#8203;dependabot](https://togithub.com/dependabot)\[bot] -
build(deps): bump the ci group with 4 updates
- PR [#&#8203;4238](https://togithub.com/fluxcd/flux2/issues/4238) -
[@&#8203;makkes](https://togithub.com/makkes) - Upgrade
github.com/fluxcd/pkg/{git,git/gogit}
- PR [#&#8203;4233](https://togithub.com/fluxcd/flux2/issues/4233) -
[@&#8203;sonbui00](https://togithub.com/sonbui00) - chore: remove
support armv6h for aur package
- PR [#&#8203;4228](https://togithub.com/fluxcd/flux2/issues/4228) -
[@&#8203;sonbui00](https://togithub.com/sonbui00) - Improve AUR package
templates
- PR [#&#8203;4227](https://togithub.com/fluxcd/flux2/issues/4227) -
[@&#8203;dependabot](https://togithub.com/dependabot)\[bot] -
build(deps): bump the ci group with 3 updates
- PR [#&#8203;4226](https://togithub.com/fluxcd/flux2/issues/4226) -
[@&#8203;somtochiama](https://togithub.com/somtochiama) - Update
description of kubeconfig specific flag
- PR [#&#8203;4222](https://togithub.com/fluxcd/flux2/issues/4222) -
[@&#8203;dependabot](https://togithub.com/dependabot)\[bot] -
build(deps): bump github.com/cyphar/filepath-securejoin from 0.2.3 to
0.2.4 in /tests/integration
- PR [#&#8203;4221](https://togithub.com/fluxcd/flux2/issues/4221) -
[@&#8203;dependabot](https://togithub.com/dependabot)\[bot] -
build(deps): bump github.com/cyphar/filepath-securejoin from 0.2.3 to
0.2.4 in /tests/azure
- PR [#&#8203;4215](https://togithub.com/fluxcd/flux2/issues/4215) -
[@&#8203;dependabot](https://togithub.com/dependabot)\[bot] -
build(deps): bump the ci group with 4 updates
- PR [#&#8203;4213](https://togithub.com/fluxcd/flux2/issues/4213) -
[@&#8203;dependabot](https://togithub.com/dependabot)\[bot] -
build(deps): bump github.com/docker/distribution from 2.8.1+incompatible
to 2.8.2+incompatible in /tests/integration
- PR [#&#8203;4212](https://togithub.com/fluxcd/flux2/issues/4212) -
[@&#8203;dependabot](https://togithub.com/dependabot)\[bot] -
build(deps): bump github.com/docker/docker from 23.0.1+incompatible to
23.0.3+incompatible in /tests/integration
- PR [#&#8203;4198](https://togithub.com/fluxcd/flux2/issues/4198) -
[@&#8203;makkes](https://togithub.com/makkes) - Add 2.1.x backport label
- PR [#&#8203;4197](https://togithub.com/fluxcd/flux2/issues/4197) -
[@&#8203;stefanprodan](https://togithub.com/stefanprodan) - Fix links to
fluxcd.io
- PR [#&#8203;4195](https://togithub.com/fluxcd/flux2/issues/4195) -
[@&#8203;dependabot](https://togithub.com/dependabot)\[bot] -
build(deps): bump the ci group with 2 updates

</details>

<details>
<summary>twpayne/chezmoi (twpayne/chezmoi)</summary>

###
[`v2.40.0`](https://togithub.com/twpayne/chezmoi/releases/tag/v2.40.0)

[Compare
Source](https://togithub.com/twpayne/chezmoi/compare/v2.39.1...v2.40.0)

#### Changelog

##### Features

- [`2858a0c`](https://togithub.com/twpayne/chezmoi/commit/2858a0c8)
feat: Implement the path-style flag for status
- [`5918296`](https://togithub.com/twpayne/chezmoi/commit/59182964)
feat: Add plugin support
- [`63cda81`](https://togithub.com/twpayne/chezmoi/commit/63cda81c)
feat: Allow overlapping, non-conflicting externals
- [`f15b158`](https://togithub.com/twpayne/chezmoi/commit/f15b158d)
feat: Add decryption of non-armored files to age command

##### Fixes

- [`cdd4f16`](https://togithub.com/twpayne/chezmoi/commit/cdd4f166) fix:
Use diff pager for all diff output if configured
- [`3667788`](https://togithub.com/twpayne/chezmoi/commit/36677884) fix:
provide a consistent error for cd to file

##### Documentation updates

- [`284baf6`](https://togithub.com/twpayne/chezmoi/commit/284baf6a)
docs: Add links to articles

</details>

<details>
<summary>weaveworks/eksctl (weaveworks/eksctl)</summary>

###
[`v0.158.0`](https://togithub.com/eksctl-io/eksctl/releases/tag/v0.158.0):
eksctl 0.158.0 (permalink)

[Compare
Source](https://togithub.com/weaveworks/eksctl/compare/0.157.0...0.158.0-rc.0)

### Release v0.158.0

#### 🐛 Bug Fixes

- Call `kubectl version` command with `--output=json` flag
([#&#8203;7032](https://togithub.com/weaveworks/eksctl/issues/7032))

#### 🧰 Maintenance

- Bump `github.com/cloudflare/cfssl` to fix indirect deps DOS
vulnerability
([#&#8203;7067](https://togithub.com/weaveworks/eksctl/issues/7067))
- Upgrade goproxy to fix DoS vulnerability
([#&#8203;7068](https://togithub.com/weaveworks/eksctl/issues/7068))

#### 📝 Documentation

- Corrected Chocolatey Install Command
([#&#8203;7063](https://togithub.com/weaveworks/eksctl/issues/7063))

#### Acknowledgments

Weaveworks would like to sincerely thank:
[@&#8203;Nyami](https://togithub.com/Nyami)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone
America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/scottames/dots).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi45Ny4xIiwidXBkYXRlZEluVmVyIjoiMzYuOTcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external pull request originating outside of the CLI core team
Projects
No open projects
The GitHub CLI
  
Needs review 🤔
Development

Successfully merging this pull request may close these issues.

None yet

3 participants