lib/jets/cli.rb
# thor_args normalized the args Array to work with our Thor command
# subclasses.
# 1. The namespace is stripe
# 2. Help is shifted in front if a help flag is detected
thor_args normalized the args Array to work with our Thor command
subclasses.
1. The namespace is stripe
2. Help is shifted in front if a help flag is detected
thor_args normalized the args Array to work with our Thor command subclasses . 1 . The namespace is stripe 2 . Help is shifted in front if a help flag is detected
def thor_args
    args = @given_args.clone
    help_args = args & help_flags
    unless help_args.empty?
      args -= help_flags 
      args[0] = meth 
      args.unshift("help")
      args.compact!
      return args
    end
    args[0] = meth
    args.compact
  end
def thor_args args = @given_args . clone help_args = args & help_flags unless help_args . empty? args -= help_flags args [ 0 ] = meth args . unshift ( "help" ) args . compact! return args end args [ 0 ] = meth args . compact end
thor_args normalized the args Array to work with our Thor command
subclasses.
thor_args normalized the args Array to work with our Thor command subclasses .
# Allow using help flags at the end of the command to trigger help menu # remove "help" and help flags from args # first command will always be the meth now since # we removed the help flags # reassigns the command without the namespace if reached here