main.c (1061B)
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 #include "command/command.h" 5 #include "license.h" 6 7 int cmd_license(int argc, const char **argv) { 8 (void)argc; 9 (void)argv; 10 const unsigned char *start = _binary_LICENSE_md_start; 11 const unsigned char *end = _binary_LICENSE_md_end; 12 size_t len = end - start; 13 fwrite(start, 1, len, stdout); 14 return 0; 15 } 16 17 void __attribute__((constructor)) cmd_license_setup() { 18 struct cmd_struct *cmd = calloc(1, sizeof(struct cmd_struct)); 19 cmd->next = commands; 20 cmd->fn = cmd_license; 21 static const char *license_names[] = {"license", NULL}; 22 cmd->name = license_names; 23 cmd->display = "license"; 24 cmd->description = "Show license information"; 25 cmd->help_text = 26 "dep license - Show license information\n" 27 "\n" 28 "Usage:\n" 29 " dep license\n" 30 "\n" 31 "Description:\n" 32 " Display the license information for dep.\n"; 33 commands = cmd; 34 }