Skip to content

Output of --help is not what I expect #1245

Closed
@sql-sith

Description

@sql-sith

This product is a fantastic idea. Thank you!

I am using C# in VS2019, and have a reference to v4.0.30319 of DragonFruit. My code has a class that starts like this:

public class BcpXfer
{

    /// <summary>
    /// bcpxfer - a utility for copying data from one SQL Server table to another
    /// </summary>
    /// <param name="fromServer">The server where the source table exists.</param>
    /// <param name="fromDatabase">The database name where the source table exists.</param>
    /// <param name="fromSchema">The schema name of the source table. Defaults to "dbo".</param>
    /// <param name="fromTable">The name of the source table.</param>
    /// <param name="toServer">The server name where the the target table exists.</param>
    /// <param name="toDatabase">The database name where the target table exists. Defaults to the value of --from-database.</param>
    /// <param name="toSchema">The schema name of the target table. Defaults to the value of --from-schema. </param>
    /// <param name="toTable">The name of the target table. Defaults to the value of --from-table.</param>
    /// <param name="batchSize">The number of rows to transfer as a single transaction. Defaults to 2500.</param>
    /// <param name="howMany">The number of rows to transfer before stopping. Defaults to 0, which means all.</param>
    /// <param name="connectionTimeout">The connection timeout in seconds for connecting to --from-server and --to-server. Defaults to 10.</param>

    static int Main(
        string fromServer,
        string fromDatabase,
        string fromTable,
        string fromSchema = null,
        string toServer = null,
        string toDatabase = null,
        string toSchema = null,
        string toTable = null,
        int? batchSize = 2500,
        int? howMany = 0,
        int? connectionTimeout = 10
    )

When it is invoked with --help, I only see the command-line parameter names and the names they map to in main. However, based on the examples here, I expected to see the parameter descriptions that are in the value section of the <param> nodes. For example, for the from-server parameter, I expect to see something like this when I invoke bcpxfer --help:

    --from-server     The server where the source table exists.

However, what I actually see is this:

      --from-server <from-server>                  fromServer

Here's the complete output of bcpxfer --help:

pwsh> .\bin\x64\Release\BcpXfer.exe --help
Usage:
  BcpXfer [options]

Options:
  --from-server <from-server>                  fromServer
  --from-database <from-database>              fromDatabase
  --from-table <from-table>                    fromTable
  --from-schema <from-schema>                  fromSchema [default: ]
  --to-server <to-server>                      toServer [default: ]
  --to-database <to-database>                  toDatabase [default: ]
  --to-schema <to-schema>                      toSchema [default: ]
  --to-table <to-table>                        toTable [default: ]
  --batch-size <batch-size>                    batchSize [default: 2500]
  --how-many <how-many>                        howMany [default: 0]
  --connection-timeout <connection-timeout>    connectionTimeout [default: 10]
  --version                                    Show version information
  -?, -h, --help                               Show help and usage information

I also compiled the snippet from the link I mentioned earlier, and instead of seeing lines like --int-option An option whose argument will bind to an int (which is what the example shows), I see --int-option <int-option> intOption [default: 42].

I'm not sure if I'm doing it wrong of it there's a glitch in the current version. Can someone help me out? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions