Changeset 4207


Ignore:
Timestamp:
03/14/08 13:11:45 (5 years ago)
Author:
thomas
Message:

opkg: print help and version messages to stdout rather than stderr. Based on
patch from Marcin Juszkiewicz <openembedded haerwu biz>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/opkg/libopkg/args.c

    r4200 r4207  
    233233{ 
    234234     if (complaint) { 
    235           fprintf(stderr, "opkg: %s\n", complaint); 
     235          printf("opkg: %s\n", complaint); 
    236236     } 
    237237     print_version(); 
    238      fprintf(stderr, "usage: opkg [options...] sub-command [arguments...]\n"); 
    239      fprintf(stderr, "where sub-command is one of:\n"); 
     238     printf("usage: opkg [options...] sub-command [arguments...]\n"); 
     239     printf("where sub-command is one of:\n"); 
    240240     
    241      fprintf(stderr, "\nPackage Manipulation:\n"); 
    242      fprintf(stderr, "\tupdate                  Update list of available packages\n"); 
    243      fprintf(stderr, "\tupgrade                 Upgrade all installed packages to latest version\n"); 
    244      fprintf(stderr, "\tinstall <pkg>           Download and install <pkg> (and dependencies)\n"); 
    245      fprintf(stderr, "\tinstall <file.ipk>      Install package <file.ipk>\n"); 
    246      fprintf(stderr, "\tconfigure [<pkg>]       Configure unpacked packages\n"); 
    247      fprintf(stderr, "\tremove <pkg|regexp>     Remove package <pkg|packages following regexp>\n"); 
    248      fprintf(stderr, "\tflag <flag> <pkg> ...   Flag package(s) <pkg>\n"); 
    249      fprintf(stderr, "\t <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)    \n"); 
     241     printf("\nPackage Manipulation:\n"); 
     242     printf("\tupdate           Update list of available packages\n"); 
     243     printf("\tupgrade                  Upgrade all installed packages to latest version\n"); 
     244     printf("\tinstall <pkg>            Download and install <pkg> (and dependencies)\n"); 
     245     printf("\tinstall <file.ipk>       Install package <file.ipk>\n"); 
     246     printf("\tconfigure [<pkg>]        Configure unpacked packages\n"); 
     247     printf("\tremove <pkg|regexp>      Remove package <pkg|packages following regexp>\n"); 
     248     printf("\tflag <flag> <pkg> ...    Flag package(s) <pkg>\n"); 
     249     printf("\t <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)     \n"); 
    250250     
    251      fprintf(stderr, "\nInformational Commands:\n"); 
    252      fprintf(stderr, "\tlist                    List available packages and descriptions\n"); 
    253      fprintf(stderr, "\tlist_installed          List all and only the installed packages and description \n"); 
    254      fprintf(stderr, "\tfiles <pkg>             List all files belonging to <pkg>\n"); 
    255      fprintf(stderr, "\tsearch <file|regexp>            Search for a package providing <file>\n"); 
    256      fprintf(stderr, "\tinfo [pkg|regexp]               Display all info for <pkg>\n"); 
    257      fprintf(stderr, "\tstatus [pkg|regexp]             Display all status for <pkg>\n"); 
    258      fprintf(stderr, "\tdownload <pkg>          Download <pkg> to current directory.\n"); 
    259      fprintf(stderr, "\tcompare_versions <v1> <op> <v2>\n"); 
    260      fprintf(stderr, "\t                          compare versions using <= < > >= = << >>\n"); 
    261      fprintf(stderr, "\tprint_architecture      prints the architecture.\n"); 
    262      fprintf(stderr, "\tprint_installation_architecture\n"); 
    263      fprintf(stderr, "\twhatdepends [-A] [pkgname|pat]+\n"); 
    264      fprintf(stderr, "\twhatdependsrec [-A] [pkgname|pat]+\n"); 
    265      fprintf(stderr, "\twhatprovides [-A] [pkgname|pat]+\n"); 
    266      fprintf(stderr, "\twhatconflicts [-A] [pkgname|pat]+\n"); 
    267      fprintf(stderr, "\twhatreplaces [-A] [pkgname|pat]+\n"); 
    268      fprintf(stderr, "\t                        prints the installation architecture.\n");     
    269      fprintf(stderr, "\nOptions:\n"); 
    270      fprintf(stderr, "\t-A                      Query all packages with whatdepends, whatprovides, whatreplaces, whatconflicts\n");  
    271      fprintf(stderr, "\t-V <level>               Set verbosity level to <level>. If no value is\n"); 
    272      fprintf(stderr, "\t--verbosity <level>      provided increase verbosity by one. Verbosity levels:\n"); 
    273      fprintf(stderr, "\t                         0 errors only\n"); 
    274      fprintf(stderr, "\t                         1 normal messages (default)\n"); 
    275      fprintf(stderr, "\t                         2 informative messages\n"); 
    276      fprintf(stderr, "\t                         3 debug output\n"); 
    277      fprintf(stderr, "\t-f <conf_file>          Use <conf_file> as the opkg configuration file\n"); 
    278      fprintf(stderr, "\t-conf <conf_file>       Default configuration file location\n"); 
    279      fprintf(stderr, "                          is %s/%s\n", ARGS_DEFAULT_CONF_FILE_DIR, ARGS_DEFAULT_CONF_FILE_NAME); 
    280      fprintf(stderr, "\t-d <dest_name>          Use <dest_name> as the the root directory for\n"); 
    281      fprintf(stderr, "\t-dest <dest_name>       package installation, removal, upgrading.\n"); 
    282      fprintf(stderr, "                          <dest_name> should be a defined dest name from\n"); 
    283      fprintf(stderr, "                          the configuration file, (but can also be a\n"); 
    284      fprintf(stderr, "                          directory name in a pinch).\n"); 
    285      fprintf(stderr, "\t-o <offline_root>       Use <offline_root> as the root directory for\n"); 
    286      fprintf(stderr, "\t-offline <offline_root> offline installation of packages.\n"); 
    287      fprintf(stderr, "\t-verbose_wget           more wget messages\n"); 
     251     printf("\nInformational Commands:\n"); 
     252     printf("\tlist             List available packages and descriptions\n"); 
     253     printf("\tlist_installed           List all and only the installed packages and description \n"); 
     254     printf("\tfiles <pkg>              List all files belonging to <pkg>\n"); 
     255     printf("\tsearch <file|regexp>             Search for a package providing <file>\n"); 
     256     printf("\tinfo [pkg|regexp]                Display all info for <pkg>\n"); 
     257     printf("\tstatus [pkg|regexp]              Display all status for <pkg>\n"); 
     258     printf("\tdownload <pkg>           Download <pkg> to current directory.\n"); 
     259     printf("\tcompare_versions <v1> <op> <v2>\n"); 
     260     printf("\t                          compare versions using <= < > >= = << >>\n"); 
     261     printf("\tprint_architecture      prints the architecture.\n"); 
     262     printf("\tprint_installation_architecture\n"); 
     263     printf("\twhatdepends [-A] [pkgname|pat]+\n"); 
     264     printf("\twhatdependsrec [-A] [pkgname|pat]+\n"); 
     265     printf("\twhatprovides [-A] [pkgname|pat]+\n"); 
     266     printf("\twhatconflicts [-A] [pkgname|pat]+\n"); 
     267     printf("\twhatreplaces [-A] [pkgname|pat]+\n"); 
     268     printf("\t                        prints the installation architecture.\n");     
     269     printf("\nOptions:\n"); 
     270     printf("\t-A                      Query all packages with whatdepends, whatprovides, whatreplaces, whatconflicts\n");  
     271     printf("\t-V <level>               Set verbosity level to <level>. If no value is\n"); 
     272     printf("\t--verbosity <level>      provided increase verbosity by one. Verbosity levels:\n"); 
     273     printf("\t                         0 errors only\n"); 
     274     printf("\t                         1 normal messages (default)\n"); 
     275     printf("\t                         2 informative messages\n"); 
     276     printf("\t                         3 debug output\n"); 
     277     printf("\t-f <conf_file>           Use <conf_file> as the opkg configuration file\n"); 
     278     printf("\t-conf <conf_file>        Default configuration file location\n"); 
     279     printf("                           is %s/%s\n", ARGS_DEFAULT_CONF_FILE_DIR, ARGS_DEFAULT_CONF_FILE_NAME); 
     280     printf("\t-d <dest_name>           Use <dest_name> as the the root directory for\n"); 
     281     printf("\t-dest <dest_name>        package installation, removal, upgrading.\n"); 
     282     printf("                           <dest_name> should be a defined dest name from\n"); 
     283     printf("                           the configuration file, (but can also be a\n"); 
     284     printf("                           directory name in a pinch).\n"); 
     285     printf("\t-o <offline_root>        Use <offline_root> as the root directory for\n"); 
     286     printf("\t-offline <offline_root>  offline installation of packages.\n"); 
     287     printf("\t-verbose_wget            more wget messages\n"); 
    288288     
    289      fprintf(stderr, "\tForce Options (use when opkg is too smart for its own good):\n"); 
    290      fprintf(stderr, "\t-force-depends          Make dependency checks warnings instead of errors\n"); 
    291      fprintf(stderr, "\t                                Install/remove package in spite of failed dependences\n"); 
    292      fprintf(stderr, "\t-force-defaults         Use default options for questions asked by opkg.\n"); 
    293      fprintf(stderr, "                          (no prompts). Note that this will not prevent\n"); 
    294      fprintf(stderr, "                          package installation scripts from prompting.\n"); 
    295      fprintf(stderr, "\t-force-reinstall        Allow opkg to reinstall a package.\n"); 
    296      fprintf(stderr, "\t-force-overwrite        Allow opkg to overwrite files from another package during an install.\n"); 
    297      fprintf(stderr, "\t-force-downgrade        Allow opkg to downgrade packages.\n"); 
    298      fprintf(stderr, "\t-force_space            Install even if there does not seem to be enough space.\n"); 
    299      fprintf(stderr, "\t-noaction               No action -- test only\n"); 
    300      fprintf(stderr, "\t-nodeps                 Do not follow dependences\n"); 
    301      fprintf(stderr, "\t-force-removal-of-dependent-packages\n"); 
    302      fprintf(stderr, "\t-recursive              Allow opkg to remove package and all that depend on it.\n"); 
    303      fprintf(stderr, "\t-autoremove             Allow opkg to remove packages that where installed automatically to satisfy dependencies.\n"); 
    304      fprintf(stderr, "\t-test                   No action -- test only\n"); 
    305      fprintf(stderr, "\t-t                      Specify tmp-dir.\n"); 
    306      fprintf(stderr, "\t--tmp-dir               Specify tmp-dir.\n"); 
    307      fprintf(stderr, "\n"); 
    308      fprintf(stderr, "\tregexp could be something like 'pkgname*' '*file*' or similar\n"); 
    309      fprintf(stderr, "\teg: opkg info 'libstd*'  or opkg search '*libop*' or opkg remove 'libncur*'\n"); 
     289     printf("\tForce Options (use when opkg is too smart for its own good):\n"); 
     290     printf("\t-force-depends           Make dependency checks warnings instead of errors\n"); 
     291     printf("\t                         Install/remove package in spite of failed dependences\n"); 
     292     printf("\t-force-defaults          Use default options for questions asked by opkg.\n"); 
     293     printf("                           (no prompts). Note that this will not prevent\n"); 
     294     printf("                           package installation scripts from prompting.\n"); 
     295     printf("\t-force-reinstall         Allow opkg to reinstall a package.\n"); 
     296     printf("\t-force-overwrite         Allow opkg to overwrite files from another package during an install.\n"); 
     297     printf("\t-force-downgrade         Allow opkg to downgrade packages.\n"); 
     298     printf("\t-force_space            Install even if there does not seem to be enough space.\n"); 
     299     printf("\t-noaction               No action -- test only\n"); 
     300     printf("\t-nodeps                 Do not follow dependences\n"); 
     301     printf("\t-force-removal-of-dependent-packages\n"); 
     302     printf("\t-recursive               Allow opkg to remove package and all that depend on it.\n"); 
     303     printf("\t-autoremove              Allow opkg to remove packages that where installed automatically to satisfy dependencies.\n"); 
     304     printf("\t-test                   No action -- test only\n"); 
     305     printf("\t-t                       Specify tmp-dir.\n"); 
     306     printf("\t--tmp-dir                Specify tmp-dir.\n"); 
     307     printf("\n"); 
     308     printf("\tregexp could be something like 'pkgname*' '*file*' or similar\n"); 
     309     printf("\teg: opkg info 'libstd*'  or opkg search '*libop*' or opkg remove 'libncur*'\n"); 
    310310     /* -force-removal-of-essential-packages    Let opkg remove essential packages.  
    311311        Using this option is almost guaranteed to break your system, hence this option 
     
    316316static void print_version(void) 
    317317{ 
    318      fprintf(stderr, "opkg version %s\n", VERSION); 
    319 } 
     318     printf("opkg version %s\n", VERSION); 
     319} 
Note: See TracChangeset for help on using the changeset viewer.