Skip to content

Enum values should be split to multiple lines #629

@damageboy

Description

@damageboy

I have the following enum:

        public enum ExampleType
        {
            PCSort128,
            PCSort256,
            AVX2,
            AVX2VacuumPacked,
            AVX2VacuumPackedx2,
            AVX2DoublePumped,
            AVX2DoublePumpedNaive,
            AVX2DoublePumpedAligned,
            AVX2DoublePumpedWithPCSort,
            AVX2DoublePumpedUnrolled,
            AVX2DoublePumpedUnrolledWithPCSort,
        }

When used in a Main function like this:

        public static unsafe void Main(ExampleType type, int size, int loops, int modulo, int forceValue = int.MinValue, double forceRate = double.NaN)

The generated help "docs" could use some love, as the different values are pushing the entire text to the right, where it's probably more sane to make them take up a few more rows.

Here' what it looks like:

Example:
  Run various quicksort/sort variants

Usage:
  Example [options]

Options:
  --type <AVX2|AVX2DoublePumped|AVX2DoublePumpedAligned|AVX2DoublePumpedNaive|AVX2DoublePumpedUnrolled|AVX2DoublePumpedUnrolledWithPCSort|AVX2DoublePumpedWithPCSort|AVX2VacuumPacked|AVX2VacuumPackedx2|PCSort128|PCSort256>
                                                                                                                                                                                                                                 The
                                                                                                                                                                                                                                 type
                                                                                                                                                                                                                                 of
                                                                                                                                                                                                                                 sort
                                                                                                                                                                                                                                 routine
                                                                                                                                                                                                                                 to
                                                                                                                                                                                                                                 invoke
  --size <size>                                                                                                                     
                                                                                                                                                                                                                                 The
                                                                                                                                                                                                                                 size
                                                                                                                                                                                                                                 of
                                                                                                                                                                                                                                 the
                                                                                                                                                                                                                                 sort
                                                                                                                                                                                                                                 problem
                                                                                                                                                                                                                                 to
                                                                                                                                                                                                                                 invoke
  --loops <loops>                                                                                                                   
                                                                                                                                                                                                                                 #
                                                                                                                                                                                                                                 of
                                                                                                                                                                                                                                 loops
                                                                                                                                                                                                                                 to
                                                                                                                                                                                                                                 re-sort
                                                                                                                                                                                                                                 the
                                                                                                                                                                                                                                 data
  --modulo <modulo>                                                                                                                 
                                                                                                                                                                                                                                 Squash
                                                                                                                                                                                                                                 all
                                                                                                                                                                                                                                 the
                                                                                                                                                                                                                                 values
                                                                                                                                                                                                                                 into
                                                                                                                                                                                                                                 a
                                                                                                                                                                                                                                 certain
                                                                                                                                                                                                                                 range
  --force-value <force-value>                                                                                                       
                                                                                                                                                                                                                                 force
                                                                                                                                                                                                                                 specific
                                                                                                                                                                                                                                 value
  --force-rate <force-rate>                                                                                                         
                                                                                                                                                                                                                                 how
                                                                                                                                                                                                                                 many
                                                                                                                                                                                                                                 elements
                                                                                                                                                                                                                                 should
                                                                                                                                                                                                                                 be
                                                                                                                                                                                                                                 the
                                                                                                                                                                                                                                 forced
                                                                                                                                                                                                                                 value
  --version                                                                                                                         
                                                                                                                                                                                                                                 Display
                                                                                                                                                                                                                                 version
                                                                                                                                                                                                                                 information

I think something along this sort of output would be generally more beneficial in cases there are long lists of enum values:

Example:
  Run various quicksort/sort variants

Usage:
  Example [options]

Options:
  --type <AVX2|AVX2DoublePumped|AVX2DoublePumpedAligned|                The type of sort routine to invoke
          AVX2DoublePumpedNaive|AVX2DoublePumpedUnrolled|
          AVX2DoublePumpedUnrolledWithPCSort|
          AVX2DoublePumpedWithPCSort|
          AVX2VacuumPacked|AVX2VacuumPackedx2|
          PCSort128|PCSort256>
  --size <size>                                                         The size of the sort problem to invoke                                                         
  --modulo <modulo>                                                     Squash all the values into a certain range                                                            
  --force-value <force-value>                                           force specific value                                                            
  --force-rate <force-rate>                                             how many elements should be the forced value                                                            
  --version                                                             Display version information                                                                                                                         

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions