fix(clap_complete_nushell): order positional arguments by index #6167
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
In clap_complete_nushell, arguments are written in the order they are added to the
Command, not according to theindexthey are specified with. If required positional arguments with a lowerindexare added to the command afteroptional positional arguments are added, nushell rejects the generated completion because nushell forbids required
arguments to come after optional arguments.
For example, if positional arguments are defined as:
.arg(Arg::new("second").index(2))(optional).arg(Arg::new("first").index(1))(required)The current output would incorrectly place
second?beforefirst, which nushell rejects.To fix this, I reordered the output so all non-positional arguments are written in their normal order, and then all
positional arguments are written, ordered by their
index.I'm not certain this is the best approach, I would appreciate feedback.