Changeset fd11144 in mainline for uspace/app/fontviewer/fontviewer.c
- Timestamp:
- 2020-07-04T21:52:35Z (8 months ago)
- Branches:
- master
- Children:
- fc4abca
- Parents:
- e79a025
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/fontviewer/fontviewer.c
re79a025 rfd11144 38 38 #include <stdlib.h> 39 39 #include <stdbool.h> 40 #include <str.h> 40 41 #include <str_error.h> 41 42 #include <window.h> … … 245 246 } 246 247 248 static void print_syntax(void) 249 { 250 printf("Syntax: %s [-d <display>]\n", NAME); 251 } 252 247 253 int main(int argc, char *argv[]) 248 254 { 249 if (argc < 2) { 250 printf("Compositor server not specified.\n"); 251 return 1; 252 } 253 254 if (argc < 3) { 255 const char *display_svc = DISPLAY_DEFAULT; 256 int i; 257 258 i = 1; 259 while (i < argc) { 260 if (str_cmp(argv[i], "-d") == 0) { 261 ++i; 262 if (i >= argc) { 263 printf("Argument missing.\n"); 264 print_syntax(); 265 return 1; 266 } 267 268 display_svc = argv[i++]; 269 } else { 270 printf("Invalid option '%s'.\n", argv[i]); 271 print_syntax(); 272 return 1; 273 } 274 } 275 276 if (i < argc) { 255 277 font_path = NULL; 256 278 } else { 257 font_path = argv[ 2];258 } 259 260 main_window = window_open( argv[1], NULL, WINDOW_MAIN, "fontviewer");279 font_path = argv[i]; 280 } 281 282 main_window = window_open(display_svc, NULL, WINDOW_MAIN, "fontviewer"); 261 283 if (!main_window) { 262 284 printf("Cannot open main window.\n");
Note: See TracChangeset
for help on using the changeset viewer.