panic: runtime error: index out of range - uru 0.8.0

Issue #85 closed
Former user created an issue

I update uru to the latest version:

uru ver uru v0.8.0 [windows/386 go1.5]

I tried to access help via: >'uru admin help' and got error

panic: runtime error: index out of range

goroutine 1 [running]: C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0x111, 0x127b6600, 0x127b2180, 0x4) C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0x154 C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0xc4, 0x127b6600, 0x127b2160, 0x5) C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0x81 main.main() C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0x477

Comments (4)

  1. Jon repo owner

    It's a bug in uru due to this code.

    I need to update to be more robust for out-of-order subcommand invocations. Thank you for reporting

    C:\>uru admin help
    panic: runtime error: index out of range
    goroutine 1 [running]:
            C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0x111*Router).Dispatch(0x11812370, 0x11816420, 0x11812170, 0x4)
            C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0x154
            C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0xc4*Router).Dispatch(0x11812380, 0x11816420, 0x11812150, 0x5)
            C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0x81
            C:/Users/Jon/Documents/GoDev/mygo1.5/src/ +0x477

    You should type uru help admin as in

    uru v0.8.0
    Usage: uru [options] CMD ARG...
    where CMD is one of:
       TAG   use ruby identified by TAG, 'auto', or 'nil'
     admin   administer uru installation
       gem   run a gem command with all registered rubies
        ls   list all registered ruby installations
      ruby   run a ruby command with all registered rubies
    for help on a particular command, type `uru help CMD`
    C:\>uru help admin
      Description: administer uru installation
      Aliases: admin
      Usage: uru admin SUBCMD ARGS
      Example: uru admin add C:\Apps\rubies\ruby-2.1\bin
    where SUBCMD is one of:
         add   register an existing ruby installation
               aliases: add
               usage: uru admin add DIR [--tag TAG] | --recurse DIR [--dirtag] | system
               eg: uru admin add C:\Apps\rubies\ruby-2.1\bin
      gemset   administer gemset installations
               aliases: gemset, gs
               usage: uru admin gemset init NAME... | rm
               eg: uru admin gemset init 211@gemset
     install   install uru
               aliases: install, in
               usage: uru admin install
               eg: uru admin install
     refresh   refresh all registered rubies
               aliases: refresh
               usage: uru admin refresh [--retag]
               eg: uru admin refresh
       retag   retag CURRENT tag value to NEW
               aliases: retag, tag
               usage: uru admin retag CURRENT NEW
               eg: uru admin retag 217p376 217p376-x64
          rm   deregister a ruby installation from uru
               aliases: rm, del
               usage: uru admin rm TAG | --all
               eg: uru admin rm 193p193
  2. Jon repo owner

    The fix will be included in the next release.

    C:\>uru ver
    uru v0.8.1.alpha [windows/386 go1.5.2]
    C:\>uru admin help
    ---> Use `uru help admin` to get admin sub-command help
    C:\>uru admin foo
    [ERROR] I don't understand the `foo` admin sub-command
  3. Log in to comment