lib/pb/cli/push.rb
def create( message = "" )
      if "help" == message
        invoke( :help, [ "create" ] );
        exit 0
      end

      if File.pipe?( STDIN ) || File.select( [STDIN], [], [], 0 ) != nil then
        message = STDIN.readlines().join( "" )
      end

      url = "https://api.pushbullet.com/v2/pushes"
      token = Utils::get_token( options )

      unless message.empty?
        args = Utils::get_push_args( options )
        args['body'] = message
        Utils::send( url, token, "post", args )
      else
        puts "Nothing to do."
      end
    end
def create( message = "" )
      if "help" == message
        invoke( :help, [ "create" ] );
        exit 0
      end

      if File.pipe?( STDIN ) || File.select( [STDIN], [], [], 0 ) != nil then
        message = STDIN.readlines().join( "" )
      end

      url = "https://api.pushbullet.com/v2/pushes"
      token = Utils::get_token( options )

      unless message.empty?
        args = Utils::get_push_args( options )
        args['body'] = message
        Utils::send( url, token, "post", args )
      else
        puts "Nothing to do."
      end
    end
method_option :person, :aliases => "-p", :desc => "Delete the file after parsing it"