Commander-API  V2.1.0
Simple Command Parser
Loading...
Searching...
No Matches
Commander-API-Commands.cpp
Go to the documentation of this file.
1/*
2 * Created on Oct. 01 2022
3 *
4 * Copyright (c) 2020 - Daniel Hajnal
5 * hajnal.daniel96@gmail.com
6 * This file is part of the Commander-API project.
7 * Modified 2022.10.04
8*/
9
10/*
11MIT License
12
13Copyright (c) 2020 Daniel Hajnal
14
15Permission is hereby granted, free of charge, to any person obtaining a copy
16of this software and associated documentation files (the "Software"), to deal
17in the Software without restriction, including without limitation the rights
18to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19copies of the Software, and to permit persons to whom the Software is
20furnished to do so, subject to the following conditions:
21
22The above copyright notice and this permission notice shall be included in all
23copies or substantial portions of the Software.
24
25THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31SOFTWARE.
32*/
33
35
36void commander_millis_func( char *args, Stream *response ){
37
38 char buff[ 20 ];
39
40 sprintf( buff, "%lu", millis() );
41
42 response -> print( buff );
43
44}
45
46void commander_micros_func( char *args, Stream *response ){
47
48 char buff[ 20 ];
49
50 sprintf( buff, "%lu", micros() );
51
52 response -> print( buff );
53
54}
55
56void commander_uptime_func( char *args, Stream *response ){
57
58 char buff[ 20 ];
59
60 int day;
61 int hour;
62 int minute;
63 unsigned long second;
64
65 second = millis() / 1000;
66
67 day = ( second / 24 ) / 3600;
68 second %= (unsigned long)24 * 3600;
69
70 hour = second / 3600;
71 second %= 3600;
72
73 minute = second / 60;
74 second %= 60;
75
76 sprintf( buff, "%d days, %d:%d:%d", day, hour, minute, second );
77
78 response -> print( buff );
79
80}
81
82
83
84
85void commander_pinMode_func( char *args, Stream *response ){
86
87 int pin;
88 int direction;
89
90 int argResult;
91
92 argResult = sscanf( args, "%d %d", &pin, &direction );
93
94 if( argResult != 2 ){
95
96 #ifdef __AVR__
97 response -> print( F( "Argument error!" ) );
98 #else
99 response -> print( (const char*)"Argument error!" );
100 #endif
101
102 return;
103
104 }
105
106 if( pin < 0 || direction < 0 ){
107
108 #ifdef __AVR__
109 response -> print( F( "Argument error!" ) );
110 #else
111 response -> print( (const char*)"Argument error!" );
112 #endif
113
114 return;
115
116 }
117
118 if( direction == 0 ){
119
120 pinMode( pin, INPUT );
121
122 }
123
124 else if( direction == 1 ){
125
126 pinMode( pin, OUTPUT );
127
128 }
129
130 else{
131
132 #ifdef __AVR__
133 response -> print( F( "Argument error! Second argument has to be 1 or 0!" ) );
134 #else
135 response -> print( (const char*)"Argument error! Second argument has to be 1 or 0!" );
136 #endif
137
138 }
139
140}
141
142void commander_digitalWrite_func( char *args, Stream *response ){
143
144 int pin;
145 int state;
146
147 int argResult;
148
149 argResult = sscanf( args, "%d %d", &pin, &state );
150
151 if( argResult != 2 ){
152
153 #ifdef __AVR__
154 response -> print( F( "Argument error!" ) );
155 #else
156 response -> print( (const char*)"Argument error!" );
157 #endif
158
159 return;
160
161 }
162
163 if( pin < 0 || state < 0 ){
164
165 #ifdef __AVR__
166 response -> print( F( "Argument error!" ) );
167 #else
168 response -> print( (const char*)"Argument error!" );
169 #endif
170
171 return;
172
173 }
174
175 if( state == 0 ){
176
177 digitalWrite( pin, LOW );
178
179 }
180
181 else if( state == 1 ){
182
183 digitalWrite( pin, HIGH );
184
185 }
186
187 else{
188
189 #ifdef __AVR__
190 response -> print( F( "Argument error! Second argument has to be 1 or 0!" ) );
191 #else
192 response -> print( (const char*)"Argument error! Second argument has to be 1 or 0!" );
193 #endif
194
195 }
196
197}
198
199void commander_digitalRead_func( char *args, Stream *response ){
200
201 int pin;
202
203 int argResult;
204
205 argResult = sscanf( args, "%d", &pin );
206
207 if( argResult != 1 ){
208
209 #ifdef __AVR__
210 response -> print( F( "Argument error!" ) );
211 #else
212 response -> print( (const char*)"Argument error!" );
213 #endif
214
215 return;
216
217 }
218
219 if( pin < 0 ){
220
221 #ifdef __AVR__
222 response -> print( F( "Argument error!" ) );
223 #else
224 response -> print( (const char*)"Argument error!" );
225 #endif
226
227 return;
228
229 }
230
231 response -> print( digitalRead( pin ) );
232
233}
234
235#ifdef ARDUINO_AVR_UNO
236
237void commander_analogRead_func( char *args, Stream *response ){
238
239 int pin;
240
241 int argResult;
242
243 argResult = sscanf( args, "%d", &pin );
244
245 if( argResult != 1 ){
246
247 response -> print( F( "Argument error!" ) );
248 return;
249
250 }
251
252 switch( pin ){
253
254 case 0:
255 pin = A0;
256 break;
257
258 case 1:
259 pin = A1;
260 break;
261
262 case 2:
263 pin = A2;
264 break;
265
266 case 3:
267 pin = A3;
268 break;
269
270 case 4:
271 pin = A5;
272 break;
273
274 case 5:
275 pin = A5;
276 break;
277
278 default:
279 response -> print( F( "Argument error!" ) );
280 return;
281
282 }
283
284 response -> print( analogRead( pin ) );
285
286}
287
288#endif
289
290#ifdef ARDUINO_AVR_LEONARDO
291
292void commander_analogRead_func( char *args, Stream *response ){
293
294 int pin;
295
296 int argResult;
297
298 argResult = sscanf( args, "%d", &pin );
299
300 if( argResult != 1 ){
301
302 response -> print( F( "Argument error!" ) );
303 return;
304
305 }
306
307 switch( pin ){
308
309 case 0:
310 pin = A0;
311 break;
312
313 case 1:
314 pin = A1;
315 break;
316
317 case 2:
318 pin = A2;
319 break;
320
321 case 3:
322 pin = A3;
323 break;
324
325 case 4:
326 pin = A5;
327 break;
328
329 case 5:
330 pin = A5;
331 break;
332
333 case 6:
334 pin = A6;
335 break;
336
337 case 7:
338 pin = A7;
339 break;
340
341 case 8:
342 pin = A8;
343 break;
344
345 case 9:
346 pin = A9;
347 break;
348
349 case 10:
350 pin = A10;
351 break;
352
353 case 11:
354 pin = A11;
355 break;
356
357 default:
358 response -> print( F( "Argument error!" ) );
359 return;
360
361 }
362
363 response -> print( analogRead( pin ) );
364
365}
366
367#endif
368
369#if defined( ESP32 ) || ( ESP8266 )
370
371void commander_analogRead_func( char *args, Stream *response ){
372
373 int pin;
374
375 int argResult;
376
377 argResult = sscanf( args, "%d", &pin );
378
379 if( argResult != 1 ){
380
381 response -> print( (const char*)"Argument error!" );
382 return;
383
384 }
385
386 if( pin < 0 ){
387
388 response -> print( (const char*)"Argument error!" );
389 return;
390
391 }
392
393 response -> print( analogRead( pin ) );
394
395}
396
397#endif
398
399#if defined( ESP32 ) || ( ESP8266 )
400
401void commander_ipconfig_func( char *args, Stream *response ){
402
403 response -> println( (const char*)"Wi-Fi:\r\n" );
404
405 response -> print( (const char*)"\tIP Address . . : " );
406 response -> println( WiFi.localIP() );
407
408 response -> print( (const char*)"\tSubnet Mask . . : " );
409 response -> println( WiFi.subnetMask() );
410
411 response -> print( (const char*)"\tDefault Gateway : " );
412 response -> println( WiFi.gatewayIP() );
413
414}
415
416void commander_wifiStat_func( char *args, Stream *response ){
417
418 response -> println( (const char*)"Wi-Fi:\r\n" );
419
420 response -> print( (const char*)"\tMode: " );
421
422 switch( WiFi.getMode() ){
423
424 case WIFI_MODE_STA:
425 response -> println( "Station" );
426 break;
427
428 case WIFI_MODE_AP:
429 response -> println( "Acces Point" );
430 break;
431
432 case WIFI_MODE_APSTA:
433 response -> println( "Acces Point & Station" );
434 break;
435
436 default:
437 response -> println( "Unknown" );
438 break;
439
440 }
441
442 response -> print( (const char*)"\tRSSI: " );
443 response -> print( WiFi.RSSI() );
444 response -> println( "dBm" );
445
446 response -> print( (const char*)"\tMAC : " );
447 response -> println( WiFi.macAddress() );
448
449}
450
451void commander_wifiScan_func( char *args, Stream *response ){
452
453 int num;
454 int i;
455 bool hasLocked = false;
456
457 response -> print( (const char*)"Scanning for available networks... " );
458
459 num = WiFi.scanNetworks();
460
461 response -> println( (const char*)"[ OK ]:" );
462
463 for( i = 0; i < num; i++ ){
464
465 if( WiFi.encryptionType( i ) != WIFI_AUTH_OPEN ){
466
467 response -> print( "\t* " );
468 hasLocked = true;
469
470 }
471
472 else{
473
474 response -> print( "\t " );
475
476 }
477
478 response -> print( WiFi.SSID( i ) );
479
480 response -> println();
481
482 }
483
484 if( hasLocked ){
485 response -> print( (const char*)"\r\n * means closed network." );
486 }
487
488}
489
490#endif
491
492#ifdef ESP32
493
494void commander_configTime_func( char *args, Stream *response ){
495
496 int gmtOffset_sec;
497 int daylightOffset_sec;
498 char ntpServer[32] = "";
499 int argResult;
500
501 argResult = sscanf( args, "%d %d %s", &gmtOffset_sec, &daylightOffset_sec, ntpServer );
502
503 if( argResult == 3 ){
504
505 configTime( gmtOffset_sec, daylightOffset_sec, ntpServer );
506 response -> print( (const char*)"Time configured." );
507 return;
508
509 }
510
511 argResult = sscanf( args, "%d %d", &gmtOffset_sec, &daylightOffset_sec );
512
513 if( argResult == 2 ){
514
515 configTime( gmtOffset_sec, daylightOffset_sec, (const char*)"pool.ntp.org" );
516 response -> print( (const char*)"Time configured with default NTP server: pool.ntp.org" );
517 return;
518
519 }
520
521 else{
522
523 response -> print( (const char*)"Argument error!" );
524 return;
525
526 }
527
528}
529
530void commander_dateTime_func( char *args, Stream *response ){
531
532 struct tm timeInfo;
533
534 if( !getLocalTime( &timeInfo ) ){
535
536 response -> print( "Failed to obtain time!" );
537 return;
538
539 }
540
541 response -> print( &timeInfo, "%A, %B %d %Y %H:%M:%S" );
542
543}
544
545#endif
546
547#ifdef __AVR__
548
549void commander_neofetch_func( char *args, Stream *response ){
550
551 uint32_t rowCounter = 0;
552
553 response -> print( F(
554 "\r\n\033[1;36m"
555 " :=*%@@@@%#+- :=*%@@@@%#+- \r\n"
556 " +%@@@@@@@@@@@@@#- :*@@@@@@@@@@@@@@*: \r\n"
557 " =@@@@@*=-:::-+#@@@@@= :#@@@@%*=::::-+%@@@@#. \r\n"
558 " *@@@@- .=@@@@%:*@@@@*: .#@@@@. \r\n"
559 "+@@@% +@@@@@@@%: .## +@@@% \r\n"
560 "@@@@- .+++++++ -@@@@@* -+*@@++- @@@@:\r\n"
561 "@@@@- .+++++++ .%@@@@+ =+*@@*+- %@@@:\r\n"
562 "*@@@# =@@@@@@@#. .## -@@@@ \r\n"
563 " #@@@%: -%@@@@=#@@@@+. +@@@@: \r\n"
564 " *@@@@%=:. :-*@@@@@* -%@@@@#=:. .:-*@@@@%: \r\n"
565 " :*@@@@@@@@@@@@@@@+. -#@@@@@@@@@@@@@@%= \r\n"
566 " -+#@@@@@@%*=: -+#@@@@@@%*=. \r\n"
567 "\033[0;37m" ) );
568
569 response -> print( F( "\033[" ) );
570 response -> print( NEOFETCH_LOGO_HEIGHT );
571 response -> print( F( "A\033[51C" ) );
572
573 #ifdef NEOFETCH_FW_NAME
574 response -> print( F( "\033[1;31mFW\033[0;37m: " ) );
575 response -> print( F( NEOFETCH_FW_NAME ) );
576 response -> print( F( "\r\n\033[51C" ) );
577 rowCounter++;
578 #endif
579
580 #ifdef NEOFETCH_CPU_TYPE
581 response -> print( F( "\033[1;31mCPU\033[0;37m: " ) );
582 response -> print( F( NEOFETCH_CPU_TYPE ) );
583 response -> print( F( "\r\n\033[51C" ) );
584 rowCounter++;
585 #endif
586
587 #ifdef NEOFETCH_CPU_TYPE_AUTO
588 response -> print( F( "\033[1;31mCPU\033[0;37m: " ) );
589
590 #ifdef ARDUINO_AVR_UNO
591 response -> print( F( "AVR - Arduino UNO" ) );
592 #elif ARDUINO_AVR_LEONARDO
593 response -> print( F( "AVR - Arduino Leonardo" ) );
594 #else
595 response -> print( F( "Unknown" ) );
596 #endif
597
598 response -> print( F( "\r\n\033[51C" ) );
599 rowCounter++;
600 #endif
601
602 #ifdef NEOFETCH_COMPILER
603 response -> print( F( "\033[1;31mCompiler\033[0;37m: GCC " ) );
604 response -> print( F( NEOFETCH_COMPILER ) );
605 response -> print( F( "\r\n\033[51C" ) );
606 rowCounter++;
607 #endif
608
609 #ifdef NEOFETCH_COMPILE_DATE
610 response -> print( F( "\033[1;31mCompile Date\033[0;37m: " ) );
611 response -> print( F( NEOFETCH_COMPILE_DATE ) );
612 response -> print( F( "\r\n\033[51C" ) );
613 rowCounter++;
614 #endif
615
616 #ifdef NEOFETCH_TERMINAL
617 response -> print( F( "\033[1;31mTerminal\033[0;37m: " ) );
618 response -> print( F( NEOFETCH_TERMINAL ) );
619 response -> print( F( "\r\n\033[51C" ) );
620 rowCounter++;
621 #endif
622
623 #ifdef NEOFETCH_COMMAND_PARSER
624 response -> print( F( "\033[1;31mCMD Parser\033[0;37m: " ) );
625 response -> print( F( NEOFETCH_COMMAND_PARSER ) );
626 response -> print( F( "\r\n\033[51C" ) );
627 rowCounter++;
628 #endif
629
630 #ifdef NEOFETCH_AUTHOR
631 response -> print( F( "\033[1;31mAuthor\033[0;37m: " ) );
632 response -> print( F( NEOFETCH_AUTHOR ) );
633 response -> print( F( "\r\n\033[51C" ) );
634 rowCounter++;
635 #endif
636
637 #ifdef NEOFETCH_LICENSE
638 response -> print( F( "\033[1;31mLicense\033[0;37m: " ) );
639 response -> print( F( NEOFETCH_LICENSE ) );
640 response -> print( F( "\r\n\033[51C" ) );
641 rowCounter++;
642 #endif
643
644 response -> print( F( "\033[" ) );
645 response -> print( NEOFETCH_LOGO_HEIGHT - rowCounter );
646 response -> print( 'B' );
647
648}
649
650#else
651
652const char* neofetchLogo = {
653 "\r\n\033[1;36m"
654 " :=*%@@@@%#+- :=*%@@@@%#+- \r\n"
655 " +%@@@@@@@@@@@@@#- :*@@@@@@@@@@@@@@*: \r\n"
656 " =@@@@@*=-:::-+#@@@@@= :#@@@@%*=::::-+%@@@@#. \r\n"
657 " *@@@@- .=@@@@%:*@@@@*: .#@@@@. \r\n"
658 "+@@@% +@@@@@@@%: .## +@@@% \r\n"
659 "@@@@- .+++++++ -@@@@@* -+*@@++- @@@@:\r\n"
660 "@@@@- .+++++++ .%@@@@+ =+*@@*+- %@@@:\r\n"
661 "*@@@# =@@@@@@@#. .## -@@@@ \r\n"
662 " #@@@%: -%@@@@=#@@@@+. +@@@@: \r\n"
663 " *@@@@%=:. :-*@@@@@* -%@@@@#=:. .:-*@@@@%: \r\n"
664 " :*@@@@@@@@@@@@@@@+. -#@@@@@@@@@@@@@@%= \r\n"
665 " -+#@@@@@@%*=: -+#@@@@@@%*=. \r\n"
666 "\033[0;37m"
667};
668
669void commander_neofetch_func( char *args, Stream *response ){
670
671 uint32_t rowCounter = 0;
672
673 response -> print( neofetchLogo );
674
675 response -> print( "\033[" );
676 response -> print( NEOFETCH_LOGO_HEIGHT );
677 response -> print( "A\033[51C" );
678
679 #ifdef NEOFETCH_FW_NAME
680 response -> print( "\033[1;31mFW\033[0;37m: " );
681 response -> print( NEOFETCH_FW_NAME );
682 response -> print( "\r\n\033[51C" );
683 rowCounter++;
684 #endif
685
686 #ifdef NEOFETCH_CPU_TYPE
687 response -> print( "\033[1;31mCPU\033[0;37m: " );
688 response -> print( NEOFETCH_CPU_TYPE );
689 response -> print( "\r\n\033[51C" );
690 rowCounter++;
691 #endif
692
693 #ifdef NEOFETCH_CPU_TYPE_AUTO
694 response -> print( "\033[1;31mCPU\033[0;37m: " );
695
696 #ifdef ESP32
697 response -> print( "ESP32" );
698 #elif ESP8266
699 response -> print( "ESP8266" );
700 #else
701 response -> print( "Unknown" );
702 #endif
703
704 response -> print( "\r\n\033[51C" );
705 rowCounter++;
706 #endif
707
708 #ifdef NEOFETCH_COMPILER
709 response -> print( "\033[1;31mCompiler\033[0;37m: GCC " );
710 response -> print( NEOFETCH_COMPILER );
711 response -> print( "\r\n\033[51C" );
712 rowCounter++;
713 #endif
714
715 #ifdef NEOFETCH_COMPILE_DATE
716 response -> print( "\033[1;31mCompile Date\033[0;37m: " );
717 response -> print( NEOFETCH_COMPILE_DATE );
718 response -> print( "\r\n\033[51C" );
719 rowCounter++;
720 #endif
721
722 #ifdef NEOFETCH_TERMINAL
723 response -> print( "\033[1;31mTerminal\033[0;37m: " );
724 response -> print( NEOFETCH_TERMINAL );
725 response -> print( "\r\n\033[51C" );
726 rowCounter++;
727 #endif
728
729 #ifdef NEOFETCH_COMMAND_PARSER
730 response -> print( "\033[1;31mCMD Parser\033[0;37m: " );
731 response -> print( NEOFETCH_COMMAND_PARSER );
732 response -> print( "\r\n\033[51C" );
733 rowCounter++;
734 #endif
735
736 #ifdef NEOFETCH_AUTHOR
737 response -> print( "\033[1;31mAuthor\033[0;37m: " );
738 response -> print( NEOFETCH_AUTHOR );
739 response -> print( "\r\n\033[51C" );
740 rowCounter++;
741 #endif
742
743 #ifdef NEOFETCH_LICENSE
744 response -> print( "\033[1;31mLicense\033[0;37m: " );
745 response -> print( NEOFETCH_LICENSE );
746 response -> print( "\r\n\033[51C" );
747 rowCounter++;
748 #endif
749
750 response -> print( "\033[" );
751 response -> print( NEOFETCH_LOGO_HEIGHT - rowCounter );
752 response -> print( "B" );
753
754}
755
756#endif
757
758void commander_reboot_func( char *args, Stream *response ){
759
760 #ifdef __AVR__
761 response -> println( F( "Rebooting..." ) );
762 #else
763 response -> println( (const char*)"Rebooting..." );
764 #endif
765
766 #if defined( ESP32 ) || ( ESP8266 )
767
768 ESP.restart();
769
770 #elif __AVR__
771
772 wdt_enable( WDTO_15MS );
773 while( 1 );
774
775 #endif
776
777}
778
779#ifdef ARDUINO
780
781
782
783#endif
784
785
786void commander_sin_func( char *args, Stream *response ){
787
788 float f = atof( args );
789
790 response -> print( sin( f ), 6 );
791
792}
793
794void commander_cos_func( char *args, Stream *response ){
795
796 float f = atof( args );
797
798 response -> print( cos( f ), 6 );
799
800}
801
802void commander_not_func( char *args, Stream *response ){
803
804 int num;
805 int argResult;
806
807 argResult = sscanf( args, "%d", &num );
808
809 if( argResult != 1 ){
810
811 #ifdef __AVR__
812 response -> print( F( "Argument error!" ) );
813 #else
814 response -> print( (const char*)"Argument error!" );
815 #endif
816
817 return;
818
819 }
820
821 response -> print( !num );
822
823}
824
825void commander_random_func( char *args, Stream *response ){
826
827 int min;
828 int max;
829 int argResult;
830
831 argResult = sscanf( args, "%d %d", &min, &max );
832
833 if( argResult != 2 ){
834
835 #ifdef __AVR__
836 response -> print( F( "Argument error!" ) );
837 #else
838 response -> print( (const char*)"Argument error!" );
839 #endif
840
841 return;
842
843 }
844
845 if( min >= max ){
846
847 #ifdef __AVR__
848 response -> print( F( "Argument erro! First argument is min, second is max!" ) );
849 #else
850 response -> print( (const char*)"Argument erro! First argument is min, second is max!" );
851 #endif
852
853 return;
854
855 }
856
857 response -> print( random( min, max ) );
858
859}
860
861void commander_abs_func( char *args, Stream *response ){
862
863 float f = atof( args );
864
865 response -> print( abs( f ) );
866
867}
void commander_wifiStat_func(char *args, Stream *response)
Premade function for wifiStat command.
void commander_sin_func(char *args, Stream *response)
Premade function for sin command.
void commander_uptime_func(char *args, Stream *response)
Premade function for uptime command.
void commander_digitalWrite_func(char *args, Stream *response)
Premade function for digitalWrite command.
void commander_digitalRead_func(char *args, Stream *response)
Premade function for digitalRead command.
void commander_millis_func(char *args, Stream *response)
Premade function for millis command.
void commander_not_func(char *args, Stream *response)
Premade function for not command.
void commander_dateTime_func(char *args, Stream *response)
Premade function for wifiScan command.
void commander_configTime_func(char *args, Stream *response)
Premade function for wifiScan command.
void commander_wifiScan_func(char *args, Stream *response)
Premade function for wifiScan command.
void commander_neofetch_func(char *args, Stream *response)
Premade function for neofetch command.
void commander_reboot_func(char *args, Stream *response)
Premade function for reboot command.
void commander_cos_func(char *args, Stream *response)
Premade function for cos command.
void commander_abs_func(char *args, Stream *response)
Premade function for abs command.
void commander_pinMode_func(char *args, Stream *response)
Premade function for pinMode command.
void commander_analogRead_func(char *args, Stream *response)
Premade function for analogRead command.
void commander_micros_func(char *args, Stream *response)
Premade function for micros command.
void commander_random_func(char *args, Stream *response)
Premade function for random command.
void commander_ipconfig_func(char *args, Stream *response)
Premade function for ipconfig command.
#define NEOFETCH_LOGO_HEIGHT
The neofetch logo have this many lines.
#define NEOFETCH_TERMINAL
#define NEOFETCH_COMMAND_PARSER
#define NEOFETCH_LICENSE
#define NEOFETCH_COMPILE_DATE
#define NEOFETCH_FW_NAME
#define NEOFETCH_AUTHOR
#define NEOFETCH_COMPILER