noshortaliases fixed (meaning swapped)

This commit is contained in:
Denis Knauf 2021-12-09 14:04:27 +01:00
parent 7be062c1db
commit ec025652c9

View file

@ -120,10 +120,13 @@ class DenCli::Sub
name = name.to_s unless name.nil?
@subs[name] = obj
if @noshortaliases
DenCli.gen_aliases( name, min) {|a| @aliases[a] ||= obj }
else
warn "Alias already exists: #{full_cmd.join ' '} #{name}" if @aliases.has_key? name
warn "Command/Alias already exists: #{full_cmd.join ' '} #{name}" if @aliases.has_key? name
@aliases[name] = obj
else
DenCli.gen_aliases name, min do |a|
warn "Command/Alias already exists: #{full_cmd.join ' '} #{a}" if @aliases.has_key? a
@aliases[a] ||= obj
end
end
if aliases
[*aliases].each do |a|