ncneofetch: accept -v

This commit is contained in:
nick black 2021-08-30 19:54:52 -04:00
parent ff247c362d
commit ae1121402d
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
5 changed files with 38 additions and 10 deletions

View File

@ -8,7 +8,7 @@ ncneofetch - Generate low-effort posts for r/unixporn
# SYNOPSIS
**ncneofetch**
**ncneofetch** [**-v**]
# DESCRIPTION
@ -18,6 +18,8 @@ and displays some system information. It is a blatant ripoff of
# OPTIONS
**-v**: Increase verbosity.
# NOTES
Optimal display requires a terminal advertising the **rgb** terminfo(5)

View File

@ -661,13 +661,31 @@ ncneofetch(struct notcurses* nc){
return 0;
}
int main(void){
static void
usage(const char* arg0, FILE* fp){
fprintf(fp, "usage: %s [ -v ]\n", arg0);
if(fp == stderr){
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
int main(int argc, char** argv){
struct notcurses_options opts = {
.flags = NCOPTION_SUPPRESS_BANNERS
| NCOPTION_NO_ALTERNATE_SCREEN
| NCOPTION_NO_CLEAR_BITMAPS
| NCOPTION_PRESERVE_CURSOR,
};
if(argc > 2){
usage(argv[0], stderr);
}else if(argc == 2){
if(strcmp(argv[1], "-v") == 0){
opts.loglevel = NCLOGLEVEL_VERBOSE;
}else{
usage(argv[0], stderr);
}
}
struct notcurses* nc = notcurses_init(&opts, NULL);
if(nc == NULL){
return EXIT_FAILURE;

View File

@ -2,7 +2,7 @@
#include <stdlib.h>
#include <strings.h>
// Output of "neofetch-ripper /usr/bin/neofetch"
// Generated on Thu Jul 15 02:57:03 AM UTC 2021
// Generated on Mon 30 Aug 2021 04:06:25 AM UTC
// Copyright Dylan Araps under an MIT License
// The MIT License (MIT)
//

View File

@ -761,6 +761,7 @@ int ncplane_resize_internal(ncplane* n, int keepy, int keepx, int keepleny,
}
if(n->tam){
loginfo("TAM realloc to %d entries\n", newarea);
// FIXME first, free any disposed auxiliary vectors!
tament* tmptam = realloc(n->tam, sizeof(*tmptam) * newarea);
if(tmptam == NULL){
free(fb);

View File

@ -52,14 +52,16 @@ setup_sixel_bitmaps(tinfo* ti, int fd, bool invert80){
}else{
ti->pixel_init = sixel_init;
}
ti->pixel_scrub = sixel_scrub;
ti->pixel_remove = NULL;
ti->pixel_draw = sixel_draw;
ti->pixel_draw_late = NULL;
ti->pixel_scrub = sixel_scrub;
ti->pixel_wipe = sixel_wipe;
ti->pixel_remove = NULL;
ti->pixel_commit = NULL;
ti->pixel_move = NULL;
ti->pixel_shutdown = sixel_shutdown;
ti->pixel_scroll = NULL;
ti->pixel_wipe = sixel_wipe;
ti->pixel_shutdown = sixel_shutdown;
ti->pixel_clear_all = NULL;
ti->pixel_rebuild = sixel_rebuild;
ti->pixel_trans_auxvec = sixel_trans_auxvec;
ti->sprixel_scale_height = 6;
@ -106,12 +108,17 @@ setup_kitty_bitmaps(tinfo* ti, int fd, kitty_graphics_e level){
#ifdef __linux__
static inline void
setup_fbcon_bitmaps(tinfo* ti, int fd){
ti->pixel_rebuild = fbcon_rebuild;
ti->pixel_wipe = fbcon_wipe;
ti->pixel_scrub = fbcon_scrub;
ti->pixel_remove = NULL;
ti->pixel_draw = NULL;
ti->pixel_draw_late = fbcon_draw;
ti->pixel_commit = NULL;
ti->pixel_move = NULL;
ti->pixel_scroll = fbcon_scroll;
ti->pixel_scrub = fbcon_scrub;
ti->pixel_shutdown = NULL;
ti->pixel_clear_all = NULL;
ti->pixel_rebuild = fbcon_rebuild;
ti->pixel_wipe = fbcon_wipe;
ti->pixel_trans_auxvec = kitty_trans_auxvec;
set_pixel_blitter(fbcon_blit);
sprite_init(ti, fd);