Skip to content

Commit 7657f17

Browse files
committed
fixing the -a option in user-list
Signed-off-by: talktovikas <[email protected]>
1 parent 50e86d2 commit 7657f17

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/chef-server-ctl/plugins/wrap-knife.rb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,20 @@ def transform_knife_opc_args(args, chef_server_ctl_cmd, _knife_noun, _knife_verb
204204
end
205205

206206
when "user-list"
207-
# Handle --all-info option (not supported in native knife)
208-
if transformed.include?("--all-info") || transformed.include?("-a")
209-
transformed = transformed.reject { |arg| %w[--all-info -a].include?(arg) }
210-
end
207+
# Convert -a to --all-users for consistency
208+
# Both should trigger verbose user list output
209+
transformed = transformed.map do |arg|
210+
next if arg.nil?
211+
case arg
212+
when "-a"
213+
"--all-users"
214+
when "--all-info"
215+
# Legacy knife-opc flag, map to --all-users
216+
"--all-users"
217+
else
218+
arg
219+
end
220+
end.compact
211221
end
212222

213223
transformed

0 commit comments

Comments
 (0)