Skip to content

Commit

Permalink
Added id to @v
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudje committed Mar 11, 2024
1 parent 1705b55 commit a585dff
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,14 @@ class ShipArgumentParser(private val source: VSCommandSource?, private var selec
.filter { it.startsWith(builder.remaining) }
.forEach { builder.suggest(it) }
}

"limit" -> {}
"id" ->
suggest { builder, source ->
source.shipWorld.allShips
.map { it.id.toString() }
.filter { it.startsWith(builder.remaining) }
.forEach { builder.suggest(it) }
}
else -> throw ERROR_UNKNOWN_OPTION.create(option)
}

Expand All @@ -155,7 +161,7 @@ class ShipArgumentParser(private val source: VSCommandSource?, private var selec

this.slug = slug
}

"id" -> id = reader.readLong()
"limit" -> limit = reader.readInt()
else -> throw ERROR_UNKNOWN_OPTION.create(option)
}
Expand Down

0 comments on commit a585dff

Please sign in to comment.