<commit_before>/*
 * help-cmd.c -- Provide help
 *
 * ====================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at http://subversion.tigris.org/license-1.html.
 * If newer versions of this license are posted there, you may use a
 * newer version instead, at your option.
 * ====================================================================
 */

/* ==================================================================== */




/*** Includes. ***/

#include "svn_client.h"
#include "svn_string.h"
#include "svn_error.h"
#include "cl.h"

#include "svn_private_config.h"  /* for SVN_VERSION */



/*** Code. ***/

/* Print the canonical command name for CMD, all its aliases,
   and if HELP is set, print the help string for the command too. */
static void
print_command_info (const svn_cl__cmd_desc_t *cmd_desc,
                    svn_boolean_t help, 
                    apr_pool_t *pool)
{
  const svn_cl__cmd_desc_t *this_cmd
    = svn_cl__get_canonical_command (cmd_desc->name);
  const svn_cl__cmd_desc_t *canonical_cmd = this_cmd;
  svn_boolean_t first_time;

  /* Print the canonical command name. */
  fputs (canonical_cmd->name, stdout);

  /* Print the list of aliases. */
  first_time = TRUE;
  for (this_cmd++; (this_cmd->name && this_cmd->is_alias); this_cmd++) 
    {
      if (first_time) {
        printf (" (");
        first_time = FALSE;
      }
      else
        printf (", ");
      
      printf ("%s", this_cmd->name);
    }

  if (! first_time)
    printf (")");
  
  if (help)
    printf (": %s\n", canonical_cmd->help);
}


/* Print a generic (non-command-specific) usage message. */
static void
print_generic_help (apr_pool_t *pool)
{
  static const char usage[] =
    "usage: svn <subcommand> [options] [args]\n"
    "Type \"svn help <subcommand>\" for help on a specific subcommand.\n"
    "\n"
    "Most subcommands take file and/or directory arguments, recursing\n"
    "on the directories.  If no arguments are supplied to such a\n"
    "command, it will recurse on the current directory (inclusive) by\n" 
    "default.\n"
    "\n"
    "Available subcommands:\n";

  static const char info[] =
    "Subversion is a tool for revision control.\n"
    "For additional information, see http://subversion.tigris.org\n";

  int i = 0;

  printf ("%s", usage);
  while (svn_cl__cmd_table[i].name) 
    {
      /*  for (i = 0; i < max; i++) */
      if (! svn_cl__cmd_table[i].is_alias)
        {
          printf ("   ");
          print_command_info (svn_cl__cmd_table + i, FALSE, pool);
          printf ("\n");
        }
      i++;
    }

  printf ("\nSubversion, version %s\n", SVN_VERSION);
  printf ("%s\n", info);

}


static svn_error_t *
print_version_info (apr_pool_t *pool)
{
  void *ra_baton;
  svn_string_t *descriptions;
  static const char info[] =
    "Copyright (C) 2000-2001 CollabNet.  All rights reserved.\n"
    "\n"
    "Subversion is released under CollabNet's open source license,\n"
    "which is available at http://subversion.tigris.org\n";

  printf ("\nSubversion, version %s  (client)\n\n", SVN_VERSION);<commit_msg>(print_generic_help): Don't print version info as part of help. Submitted by: <NAME> <<EMAIL>>.<commit_after>/*
 * help-cmd.c -- Provide help
 *
 * ====================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at http://subversion.tigris.org/license-1.html.
 * If newer versions of this license are posted there, you may use a
 * newer version instead, at your option.
 * ====================================================================
 */

/* ==================================================================== */




/*** Includes. ***/

#include "svn_client.h"
#include "svn_string.h"
#include "svn_error.h"
#include "cl.h"

#include "svn_private_config.h"  /* for SVN_VERSION */



/*** Code. ***/

/* Print the canonical command name for CMD, all its aliases,
   and if HELP is set, print the help string for the command too. */
static void
print_command_info (const svn_cl__cmd_desc_t *cmd_desc,
                    svn_boolean_t help, 
                    apr_pool_t *pool)
{
  const svn_cl__cmd_desc_t *this_cmd
    = svn_cl__get_canonical_command (cmd_desc->name);
  const svn_cl__cmd_desc_t *canonical_cmd = this_cmd;
  svn_boolean_t first_time;

  /* Print the canonical command name. */
  fputs (canonical_cmd->name, stdout);

  /* Print the list of aliases. */
  first_time = TRUE;
  for (this_cmd++; (this_cmd->name && this_cmd->is_alias); this_cmd++) 
    {
      if (first_time) {
        printf (" (");
        first_time = FALSE;
      }
      else
        printf (", ");
      
      printf ("%s", this_cmd->name);
    }

  if (! first_time)
    printf (")");
  
  if (help)
    printf (": %s\n", canonical_cmd->help);
}


/* Print a generic (non-command-specific) usage message. */
static void
print_generic_help (apr_pool_t *pool)
{
  static const char usage[] =
    "usage: svn <subcommand> [options] [args]\n"
    "Type \"svn help <subcommand>\" for help on a specific subcommand.\n"
    "\n"
    "Most subcommands take file and/or directory arguments, recursing\n"
    "on the directories.  If no arguments are supplied to such a\n"
    "command, it will recurse on the current directory (inclusive) by\n" 
    "default.\n"
    "\n"
    "Available subcommands:\n";

  static const char info[] =
    "Subversion is a tool for revision control.\n"
    "For additional information, see http://subversion.tigris.org\n";

  int i = 0;

  printf ("%s", usage);
  while (svn_cl__cmd_table[i].name) 
    {
      /*  for (i = 0; i < max; i++) */
      if (! svn_cl__cmd_table[i].is_alias)
        {
          printf ("   ");
          print_command_info (svn_cl__cmd_table + i, FALSE, pool);
          printf ("\n");
        }
      i++;
    }

  printf ("\n");
  printf ("%s\n", info);

}


static svn_error_t *
print_version_info (apr_pool_t *pool)
{
  void *ra_baton;
  svn_string_t *descriptions;
  static const char info[] =
    "Copyright (C) 2000-2001 CollabNet.  All rights reserved.\n"
    "\n"
    "Subversion is released under CollabNet's open source license,\n"
    "which is available at http://subversion.tigris.org\n";

  printf ("\nSubversion, version %s  (client)\n\n", SVN_VERSION);
{'fraction_non_alphanumeric': 0.18491813129037105, 'fraction_numerical': 0.0057082770016523956, 'mean_word_length': 3.042501517911354, 'pattern_counts': {'":': 2, '<': 12, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5690854', 'n_tokens_mistral': 2239, 'n_tokens_neox': 2120, 'n_words': 620}