~ubuntu-branches/ubuntu/trusty/apt/trusty

« back to all changes in this revision

Viewing changes to apt-private/private-moo.cc

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-04-01 17:48:58 UTC
  • mfrom: (1.4.87 sid)
  • Revision ID: package-import@ubuntu.com-20140401174858-4mv29mm29zu22fn1
Tags: 1.0.1ubuntu1
merge with the debian/sid 1.0.1 version
(LP: #1302033)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#include <apt-pkg/cmndline.h>
14
14
#include <apt-pkg/strutl.h>
15
15
 
16
 
#include <strings.h>
 
16
#include <apt-private/private-moo.h>
 
17
#include <apt-private/private-output.h>
 
18
 
 
19
#include <stddef.h>
 
20
#include <string.h>
 
21
#include <time.h>
 
22
#include <iostream>
17
23
#include <sstream>
18
 
 
19
 
#include "private-moo.h"
20
 
#include "private-output.h"
 
24
#include <string>
21
25
 
22
26
#include <apti18n.h>
23
27
                                                                        /*}}}*/
24
28
 
25
 
std::string getMooLine() {                                              /*{{{*/
 
29
static std::string getMooLine() {                                       /*{{{*/
26
30
   time_t const timenow = time(NULL);
27
31
   struct tm special;
28
32
   localtime_r(&timenow, &special);
60
64
   return out.str();
61
65
}
62
66
                                                                        /*}}}*/
63
 
bool printMooLine() {                                                   /*{{{*/
 
67
static bool printMooLine() {                                            /*{{{*/
64
68
   std::cerr << getMooLine() << std::endl;
65
69
   return true;
66
70
}
67
71
                                                                        /*}}}*/
68
 
bool DoMoo1(CommandLine &CmdL)                                          /*{{{*/
 
72
bool DoMoo1(CommandLine &)                                              /*{{{*/
69
73
{
70
74
   // our trustworthy super cow since 2001
71
75
   if (_config->FindI("quiet") >= 2)
83
87
   return true;
84
88
}
85
89
                                                                        /*}}}*/
86
 
bool DoMoo2(CommandLine &CmdL)                                          /*{{{*/
 
90
bool DoMoo2(CommandLine &)                                              /*{{{*/
87
91
{
88
92
   // by Fernando Ribeiro in lp:56125
89
93
   if (_config->FindI("quiet") >= 2)
102
106
   else
103
107
   {
104
108
      c1out <<
105
 
         OutputInDepth(depth, " ") << "         \e[1;97m(\e[0;33m__\e[1;97m)\e[0m\n" <<
106
 
         OutputInDepth(depth, " ") << " \e[31m_______\e[33m~(\e[1;34m..\e[0;33m)~\e[0m\n" <<
107
 
         OutputInDepth(depth, " ") << "   \e[33m,----\e[31m\\\e[33m(\e[1;4;35moo\e[0;33m)\e[0m\n" <<
108
 
         OutputInDepth(depth, " ") << "  \e[33m/|____|,'\e[0m\n" <<
109
 
         OutputInDepth(depth, " ") << " \e[1;5;97m*\e[0;33m /\\  /\\\e[0m\n" <<
110
 
         "\e[32m";
 
109
         OutputInDepth(depth, " ") << "         \033[1;97m(\033[0;33m__\033[1;97m)\033[0m\n" <<
 
110
         OutputInDepth(depth, " ") << " \033[31m_______\033[33m~(\033[1;34m..\033[0;33m)~\033[0m\n" <<
 
111
         OutputInDepth(depth, " ") << "   \033[33m,----\033[31m\\\033[33m(\033[1;4;35moo\033[0;33m)\033[0m\n" <<
 
112
         OutputInDepth(depth, " ") << "  \033[33m/|____|,'\033[0m\n" <<
 
113
         OutputInDepth(depth, " ") << " \033[1;5;97m*\033[0;33m /\\  /\\\033[0m\n" <<
 
114
         "\033[32m";
111
115
      for (size_t i = moo.length()/2; i > 1; --i)
112
116
         c1out << "wW";
113
117
 
114
 
      c1out << "w\e[0m\n" << moo;
 
118
      c1out << "w\033[0m\n" << moo;
115
119
   }
116
120
 
117
121
   return true;
118
122
}
119
123
                                                                        /*}}}*/
120
 
bool DoMoo3(CommandLine &CmdL)                                          /*{{{*/
 
124
bool DoMoo3(CommandLine &)                                              /*{{{*/
121
125
{
122
126
   // by Robert Millan in deb:134156
123
127
   if (_config->FindI("quiet") >= 2)
134
138
   return true;
135
139
}
136
140
                                                                        /*}}}*/
137
 
bool DoMooApril(CommandLine &CmdL)                                      /*{{{*/
 
141
bool DoMooApril(CommandLine &)                                          /*{{{*/
138
142
{
139
143
   // by Christopher Allan Webber and proposed by Paul Tagliamonte
140
144
   // in a "Community outreach": https://lists.debian.org/debian-devel/2013/04/msg00045.html