Sha256: f4892675d8a1e8ef47e967696fbcadaceebe281d4899c4653c1def5e2cc53820
Contents?: true
Size: 925 Bytes
Versions: 1
Compression:
Stored size: 925 Bytes
Contents
#!/usr/bin/env ruby require 'huami' require 'optparse' require 'highline/import' require 'clipboard' options = {} optparse = OptionParser.new do |opts| opts.banner = "Usage: huami [options] key" options[:copy] = false opts.on('-c', '--copy', 'Copy password to the clipboard instead of output.') do options[:copy] = true end opts.on('-h', '--help', 'Display this screen.') do puts opts exit 1 end opts.on('-v', '--version', 'Print the version number of huami to the standard output stream.') do puts Gem.loaded_specs['huami'].version exit 0 end end optparse.parse! if ARGV.length != 1 puts optparse.help exit 1 end key = ARGV[0] password = ask("Enter password: ") { |q| q.echo = false } hash_password = Huami.huami(key, password) if options[:copy] Clipboard.copy hash_password puts 'The password has been copyed to your clipboard.' elsif puts hash_password end exit 0
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
huami-1.0.3 | bin/huami |