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

OS-8498 Want 'piadm destroy' as an alias for 'piadm remove' #1080

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion man/usr/share/man/man8/piadm.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ piadm(8) -- Manage SmartOS Platform Images
piadm bootable -e [ -i <source> ] <ZFS-pool-name>
piadm install <source> [ZFS-pool-name]
piadm list [ZFS-pool-name]
piadm remove <PI-stamp> [ZFS-pool-name]
Copy link
Contributor

Choose a reason for hiding this comment

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

Because "destroy" realphabetizes things, you'll have to re-sort this list.

piadm destroy|remove <PI-stamp> [ZFS-pool-name]
piadm update [ZFS-pool-name]

## DESCRIPTION
Expand Down Expand Up @@ -256,12 +256,16 @@ piadm(8) -- Manage SmartOS Platform Images
Lists the available platform images (and boot images) on bootable
pools.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same with this section needing to move.

piadm destroy <PI-stamp> [ZFS-pool-name]
piadm remove <PI-stamp> [ZFS-pool-name]

The opposite of `install`, and only accepts a PI-stamp. If a boot
image exists with the specified PI-stamp, it will also be removed
unless it is the only boot image available.

`destroy` and `remove` are synonyms, for those used to other
distros' `beadm`.

This command is disallowed on Triton Compute Nodes.

piadm update [ZFS-pool-name]
Expand Down
5 changes: 3 additions & 2 deletions src/piadm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# Copyright 2022 Joyent, Inc.
# Copyright 2022 MNX Cloud, Inc.
# Copyright 2023 Jason King
#

# shellcheck disable=1091
Expand Down Expand Up @@ -54,7 +55,7 @@ usage() {
eecho " piadm bootable [-d] [-e [-i <source>]] [-r] [ZFS-pool-name]"
eecho " piadm install <source> [ZFS-pool-name]"
eecho " piadm list <-H> [ZFS-pool-name]"
eecho " piadm remove <PI-stamp> [ZFS-pool-name]"
Copy link
Contributor

Choose a reason for hiding this comment

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

And same with the help message.

eecho " piadm destroy|remove <PI-stamp> [ZFS-pool-name]"
eecho " piadm update [ZFS-pool-name]"
err ""
}
Expand Down Expand Up @@ -1544,7 +1545,7 @@ case $cmd in
list "$@"
;;

remove )
destroy | remove )
privcheck remove
standalone_only remove
Copy link
Contributor

Choose a reason for hiding this comment

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

Change standalone_only remove to standalone_only "$cmd" please.

remove "$@"
Expand Down