From 323ba93afe050c56c6047f3a4c4f735402b09c78 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Mon, 15 Dec 2008 00:01:35 -0500 Subject: opkg: print help and version messages to stdout rather than stderr. Based on patch from Marcin Juszkiewicz git-svn-id: http://opkg.googlecode.com/svn/trunk@54 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg') diff --git a/libopkg/args.c b/libopkg/args.c index 5431e9f..8f6d4ee 100644 --- a/libopkg/args.c +++ b/libopkg/args.c @@ -232,81 +232,81 @@ int args_parse(args_t *args, int argc, char *argv[]) void args_usage(char *complaint) { if (complaint) { - fprintf(stderr, "opkg: %s\n", complaint); + printf("opkg: %s\n", complaint); } print_version(); - fprintf(stderr, "usage: opkg [options...] sub-command [arguments...]\n"); - fprintf(stderr, "where sub-command is one of:\n"); + printf("usage: opkg [options...] sub-command [arguments...]\n"); + printf("where sub-command is one of:\n"); - fprintf(stderr, "\nPackage Manipulation:\n"); - fprintf(stderr, "\tupdate Update list of available packages\n"); - fprintf(stderr, "\tupgrade Upgrade all installed packages to latest version\n"); - fprintf(stderr, "\tinstall Download and install (and dependencies)\n"); - fprintf(stderr, "\tinstall Install package \n"); - fprintf(stderr, "\tconfigure [] Configure unpacked packages\n"); - fprintf(stderr, "\tremove Remove package \n"); - fprintf(stderr, "\tflag ... Flag package(s) \n"); - fprintf(stderr, "\t =hold|noprune|user|ok|installed|unpacked (one per invocation) \n"); + printf("\nPackage Manipulation:\n"); + printf("\tupdate Update list of available packages\n"); + printf("\tupgrade Upgrade all installed packages to latest version\n"); + printf("\tinstall Download and install (and dependencies)\n"); + printf("\tinstall Install package \n"); + printf("\tconfigure [] Configure unpacked packages\n"); + printf("\tremove Remove package \n"); + printf("\tflag ... Flag package(s) \n"); + printf("\t =hold|noprune|user|ok|installed|unpacked (one per invocation) \n"); - fprintf(stderr, "\nInformational Commands:\n"); - fprintf(stderr, "\tlist List available packages and descriptions\n"); - fprintf(stderr, "\tlist_installed List all and only the installed packages and description \n"); - fprintf(stderr, "\tfiles List all files belonging to \n"); - fprintf(stderr, "\tsearch Search for a package providing \n"); - fprintf(stderr, "\tinfo [pkg|regexp] Display all info for \n"); - fprintf(stderr, "\tstatus [pkg|regexp] Display all status for \n"); - fprintf(stderr, "\tdownload Download to current directory.\n"); - fprintf(stderr, "\tcompare_versions \n"); - fprintf(stderr, "\t compare versions using <= < > >= = << >>\n"); - fprintf(stderr, "\tprint_architecture prints the architecture.\n"); - fprintf(stderr, "\tprint_installation_architecture\n"); - fprintf(stderr, "\twhatdepends [-A] [pkgname|pat]+\n"); - fprintf(stderr, "\twhatdependsrec [-A] [pkgname|pat]+\n"); - fprintf(stderr, "\twhatprovides [-A] [pkgname|pat]+\n"); - fprintf(stderr, "\twhatconflicts [-A] [pkgname|pat]+\n"); - fprintf(stderr, "\twhatreplaces [-A] [pkgname|pat]+\n"); - fprintf(stderr, "\t prints the installation architecture.\n"); - fprintf(stderr, "\nOptions:\n"); - fprintf(stderr, "\t-A Query all packages with whatdepends, whatprovides, whatreplaces, whatconflicts\n"); - fprintf(stderr, "\t-V Set verbosity level to . If no value is\n"); - fprintf(stderr, "\t--verbosity provided increase verbosity by one. Verbosity levels:\n"); - fprintf(stderr, "\t 0 errors only\n"); - fprintf(stderr, "\t 1 normal messages (default)\n"); - fprintf(stderr, "\t 2 informative messages\n"); - fprintf(stderr, "\t 3 debug output\n"); - fprintf(stderr, "\t-f Use as the opkg configuration file\n"); - fprintf(stderr, "\t-conf Default configuration file location\n"); - fprintf(stderr, " is %s/%s\n", ARGS_DEFAULT_CONF_FILE_DIR, ARGS_DEFAULT_CONF_FILE_NAME); - fprintf(stderr, "\t-d Use as the the root directory for\n"); - fprintf(stderr, "\t-dest package installation, removal, upgrading.\n"); - fprintf(stderr, " should be a defined dest name from\n"); - fprintf(stderr, " the configuration file, (but can also be a\n"); - fprintf(stderr, " directory name in a pinch).\n"); - fprintf(stderr, "\t-o Use as the root directory for\n"); - fprintf(stderr, "\t-offline offline installation of packages.\n"); - fprintf(stderr, "\t-verbose_wget more wget messages\n"); + printf("\nInformational Commands:\n"); + printf("\tlist List available packages and descriptions\n"); + printf("\tlist_installed List all and only the installed packages and description \n"); + printf("\tfiles List all files belonging to \n"); + printf("\tsearch Search for a package providing \n"); + printf("\tinfo [pkg|regexp] Display all info for \n"); + printf("\tstatus [pkg|regexp] Display all status for \n"); + printf("\tdownload Download to current directory.\n"); + printf("\tcompare_versions \n"); + printf("\t compare versions using <= < > >= = << >>\n"); + printf("\tprint_architecture prints the architecture.\n"); + printf("\tprint_installation_architecture\n"); + printf("\twhatdepends [-A] [pkgname|pat]+\n"); + printf("\twhatdependsrec [-A] [pkgname|pat]+\n"); + printf("\twhatprovides [-A] [pkgname|pat]+\n"); + printf("\twhatconflicts [-A] [pkgname|pat]+\n"); + printf("\twhatreplaces [-A] [pkgname|pat]+\n"); + printf("\t prints the installation architecture.\n"); + printf("\nOptions:\n"); + printf("\t-A Query all packages with whatdepends, whatprovides, whatreplaces, whatconflicts\n"); + printf("\t-V Set verbosity level to . If no value is\n"); + printf("\t--verbosity provided increase verbosity by one. Verbosity levels:\n"); + printf("\t 0 errors only\n"); + printf("\t 1 normal messages (default)\n"); + printf("\t 2 informative messages\n"); + printf("\t 3 debug output\n"); + printf("\t-f Use as the opkg configuration file\n"); + printf("\t-conf Default configuration file location\n"); + printf(" is %s/%s\n", ARGS_DEFAULT_CONF_FILE_DIR, ARGS_DEFAULT_CONF_FILE_NAME); + printf("\t-d Use as the the root directory for\n"); + printf("\t-dest package installation, removal, upgrading.\n"); + printf(" should be a defined dest name from\n"); + printf(" the configuration file, (but can also be a\n"); + printf(" directory name in a pinch).\n"); + printf("\t-o Use as the root directory for\n"); + printf("\t-offline offline installation of packages.\n"); + printf("\t-verbose_wget more wget messages\n"); - fprintf(stderr, "\tForce Options (use when opkg is too smart for its own good):\n"); - fprintf(stderr, "\t-force-depends Make dependency checks warnings instead of errors\n"); - fprintf(stderr, "\t Install/remove package in spite of failed dependences\n"); - fprintf(stderr, "\t-force-defaults Use default options for questions asked by opkg.\n"); - fprintf(stderr, " (no prompts). Note that this will not prevent\n"); - fprintf(stderr, " package installation scripts from prompting.\n"); - fprintf(stderr, "\t-force-reinstall Allow opkg to reinstall a package.\n"); - fprintf(stderr, "\t-force-overwrite Allow opkg to overwrite files from another package during an install.\n"); - fprintf(stderr, "\t-force-downgrade Allow opkg to downgrade packages.\n"); - fprintf(stderr, "\t-force_space Install even if there does not seem to be enough space.\n"); - fprintf(stderr, "\t-noaction No action -- test only\n"); - fprintf(stderr, "\t-nodeps Do not follow dependences\n"); - fprintf(stderr, "\t-force-removal-of-dependent-packages\n"); - fprintf(stderr, "\t-recursive Allow opkg to remove package and all that depend on it.\n"); - fprintf(stderr, "\t-autoremove Allow opkg to remove packages that where installed automatically to satisfy dependencies.\n"); - fprintf(stderr, "\t-test No action -- test only\n"); - fprintf(stderr, "\t-t Specify tmp-dir.\n"); - fprintf(stderr, "\t--tmp-dir Specify tmp-dir.\n"); - fprintf(stderr, "\n"); - fprintf(stderr, "\tregexp could be something like 'pkgname*' '*file*' or similar\n"); - fprintf(stderr, "\teg: opkg info 'libstd*' or opkg search '*libop*' or opkg remove 'libncur*'\n"); + printf("\tForce Options (use when opkg is too smart for its own good):\n"); + printf("\t-force-depends Make dependency checks warnings instead of errors\n"); + printf("\t Install/remove package in spite of failed dependences\n"); + printf("\t-force-defaults Use default options for questions asked by opkg.\n"); + printf(" (no prompts). Note that this will not prevent\n"); + printf(" package installation scripts from prompting.\n"); + printf("\t-force-reinstall Allow opkg to reinstall a package.\n"); + printf("\t-force-overwrite Allow opkg to overwrite files from another package during an install.\n"); + printf("\t-force-downgrade Allow opkg to downgrade packages.\n"); + printf("\t-force_space Install even if there does not seem to be enough space.\n"); + printf("\t-noaction No action -- test only\n"); + printf("\t-nodeps Do not follow dependences\n"); + printf("\t-force-removal-of-dependent-packages\n"); + printf("\t-recursive Allow opkg to remove package and all that depend on it.\n"); + printf("\t-autoremove Allow opkg to remove packages that where installed automatically to satisfy dependencies.\n"); + printf("\t-test No action -- test only\n"); + printf("\t-t Specify tmp-dir.\n"); + printf("\t--tmp-dir Specify tmp-dir.\n"); + printf("\n"); + printf("\tregexp could be something like 'pkgname*' '*file*' or similar\n"); + printf("\teg: opkg info 'libstd*' or opkg search '*libop*' or opkg remove 'libncur*'\n"); /* -force-removal-of-essential-packages Let opkg remove essential packages. Using this option is almost guaranteed to break your system, hence this option is not even advertised in the usage statement. */ @@ -315,5 +315,5 @@ void args_usage(char *complaint) static void print_version(void) { - fprintf(stderr, "opkg version %s\n", VERSION); + printf("opkg version %s\n", VERSION); } -- cgit v0.9.1