Sha256: 970bea358d9ad5b65b74f8da4b39b11ed17767ddbaa4369d50ecd57d99d21c95

Contents?: true

Size: 456 Bytes

Versions: 772

Compression:

Stored size: 456 Bytes

Contents

#!/usr/bin/env ruby

require 'rbbt'


cmd, *rest = ARGV

aliases ||= Rbbt.etc.cmd_alias.exists? ? Rbbt.etc.cmd_alias.yaml : {}

if cmd.nil?
  aliases.each do |name, parts|
    parts = parts.collect{|p|
      p =~ /^[\w:_\/-]*$/ ? p : "'" << p << "'"
    }
    puts [Log.color(:magenta, name), parts * " "] * ": "
  end
  exit 0
end

if rest.empty?
  aliases.delete cmd
else
  aliases[cmd] = rest
end

Open.write(Rbbt.etc.cmd_alias.find,(aliases.to_yaml))

Version data entries

772 entries across 772 versions & 1 rubygems

Version Path
rbbt-util-5.14.21 share/rbbt_commands/alias
rbbt-util-5.14.20 share/rbbt_commands/alias
rbbt-util-5.14.18 share/rbbt_commands/alias
rbbt-util-5.14.17 share/rbbt_commands/alias
rbbt-util-5.14.16 share/rbbt_commands/alias
rbbt-util-5.14.15 share/rbbt_commands/alias
rbbt-util-5.14.14 share/rbbt_commands/alias
rbbt-util-5.14.12 share/rbbt_commands/alias
rbbt-util-5.14.11 share/rbbt_commands/alias
rbbt-util-5.14.10 share/rbbt_commands/alias
rbbt-util-5.14.9 share/rbbt_commands/alias
rbbt-util-5.14.8 share/rbbt_commands/alias
rbbt-util-5.14.7 share/rbbt_commands/alias
rbbt-util-5.14.6 share/rbbt_commands/alias
rbbt-util-5.14.5 share/rbbt_commands/alias
rbbt-util-5.14.4 share/rbbt_commands/alias
rbbt-util-5.14.3 share/rbbt_commands/alias
rbbt-util-5.14.2 share/rbbt_commands/alias
rbbt-util-5.14.1 share/rbbt_commands/alias
rbbt-util-5.14.0 share/rbbt_commands/alias